mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
✏️ Fix typo
This commit is contained in:
@@ -14,14 +14,18 @@ export class ZenThemeMarketplaceChild extends JSWindowActorChild {
|
||||
|
||||
initalizeZenAPI(event) {
|
||||
const verifier = this.contentWindow.document.querySelector('meta[name="zen-content-verified"]');
|
||||
|
||||
if (verifier) {
|
||||
verifier.setAttribute('content', 'verified');
|
||||
}
|
||||
|
||||
const possibleRicePage = this.collectRiceMetadata();
|
||||
|
||||
if (possibleRicePage?.id) {
|
||||
this.sendAsyncMessage('ZenThemeMarketplace:RicePage', possibleRicePage);
|
||||
return;
|
||||
}
|
||||
|
||||
this.initiateThemeMarketplace();
|
||||
this.contentWindow.document.addEventListener('ZenCheckForThemeUpdates', this.checkForThemeUpdates.bind(this));
|
||||
}
|
||||
@@ -33,7 +37,7 @@ export class ZenThemeMarketplaceChild extends JSWindowActorChild {
|
||||
id: meta.getAttribute('data-id'),
|
||||
name: meta.getAttribute('data-name'),
|
||||
author: meta.getAttribute('data-author'),
|
||||
}
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -55,7 +59,7 @@ export class ZenThemeMarketplaceChild extends JSWindowActorChild {
|
||||
return this.contentWindow.document.getElementById('install-theme');
|
||||
}
|
||||
|
||||
get actionButtonUnnstall() {
|
||||
get actionButtonUninstall() {
|
||||
return this.contentWindow.document.getElementById('install-theme-uninstall');
|
||||
}
|
||||
|
||||
@@ -64,10 +68,12 @@ export class ZenThemeMarketplaceChild extends JSWindowActorChild {
|
||||
case 'ZenThemeMarketplace:ThemeChanged': {
|
||||
const themeId = message.data.themeId;
|
||||
const actionButton = this.actionButton;
|
||||
const actionButtonInstalled = this.actionButtonUnnstall;
|
||||
const actionButtonInstalled = this.actionButtonUninstall;
|
||||
|
||||
if (actionButton && actionButtonInstalled) {
|
||||
actionButton.disabled = false;
|
||||
actionButtonInstalled.disabled = false;
|
||||
|
||||
if (await this.isThemeInstalled(themeId)) {
|
||||
actionButton.classList.add('hidden');
|
||||
actionButtonInstalled.classList.remove('hidden');
|
||||
@@ -76,36 +82,38 @@ export class ZenThemeMarketplaceChild extends JSWindowActorChild {
|
||||
actionButtonInstalled.classList.add('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 'ZenThemeMarketplace:CheckForUpdatesFinished': {
|
||||
const updates = message.data.updates;
|
||||
|
||||
this.contentWindow.document.dispatchEvent(
|
||||
new CustomEvent('ZenThemeMarketplace:CheckForUpdatesFinished', { detail: { updates } })
|
||||
);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 'ZenThemeMarketplace:GetThemeInfo': {
|
||||
const themeId = message.data.themeId;
|
||||
const theme = await this.getThemeInfo(themeId);
|
||||
|
||||
return theme;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
injectMarkplaceAPI() {
|
||||
Cu.exportFunction(
|
||||
this.installTheme.bind(this),
|
||||
this.contentWindow,
|
||||
{
|
||||
defineAs: "ZenInstallTheme",
|
||||
}
|
||||
);
|
||||
Cu.exportFunction(this.installTheme.bind(this), this.contentWindow, {
|
||||
defineAs: 'ZenInstallTheme',
|
||||
});
|
||||
}
|
||||
|
||||
async addIntallButtons() {
|
||||
const actionButton = this.actionButton;
|
||||
const actionButtonUnnstall = this.actionButtonUnnstall;
|
||||
const actionButtonUnnstall = this.actionButtonUninstall;
|
||||
const errorMessage = this.contentWindow.document.getElementById('install-theme-error');
|
||||
if (!actionButton || !actionButtonUnnstall) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user