mirror of
https://github.com/zen-browser/desktop.git
synced 2025-12-28 00:54:39 +00:00
Refactor rice page handling and metadata extraction in theme marketplace components
This commit is contained in:
@@ -417,7 +417,9 @@
|
||||
frame.call(this);
|
||||
}
|
||||
|
||||
openRicePage({ id, name, author }) {
|
||||
openRicePage({ name, id, author }) {
|
||||
console.log("Opening rice page: ", name, id, author);
|
||||
gBrowser.removeTab(gBrowser.selectedTab);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ export class ZenThemeMarketplaceChild extends JSWindowActorChild {
|
||||
verifier.setAttribute('content', 'verified');
|
||||
}
|
||||
const possibleRicePage = this.collectRiceMetadata();
|
||||
if (possibleRicePage) {
|
||||
this.sendAsyncMessage('ZenThemeMarketplace:RicePage', { data: possibleRicePage });
|
||||
if (possibleRicePage?.id) {
|
||||
this.sendAsyncMessage('ZenThemeMarketplace:RicePage', possibleRicePage);
|
||||
return;
|
||||
}
|
||||
this.initiateThemeMarketplace();
|
||||
@@ -27,11 +27,11 @@ export class ZenThemeMarketplaceChild extends JSWindowActorChild {
|
||||
}
|
||||
|
||||
collectRiceMetadata() {
|
||||
const meta = this.contentWindow.document.querySelector('meta[name="rize-metadata"]');
|
||||
const meta = this.contentWindow.document.querySelector('meta[name="zen-rice-data"]');
|
||||
if (meta) {
|
||||
return {
|
||||
id: meta.getAttribute('data-id'),
|
||||
name: meta.getAttribute('data-title'),
|
||||
name: meta.getAttribute('data-name'),
|
||||
author: meta.getAttribute('data-author'),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,8 +42,7 @@ export class ZenThemeMarketplaceParent extends JSWindowActorParent {
|
||||
}
|
||||
|
||||
openRicePage(window, data) {
|
||||
console.info(this.browsingContext);
|
||||
window.gZenThemeMarketplaceManager.openRicePage(data);
|
||||
window.gZenThemePicker.riceManager.openRicePage(data);
|
||||
}
|
||||
|
||||
compareversion(version1, version2) {
|
||||
|
||||
Reference in New Issue
Block a user