mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 19:29:58 +02:00
Fix theme store API
This commit is contained in:
parent
fb65629993
commit
845d26405b
1 changed files with 6 additions and 2 deletions
|
@ -95,8 +95,12 @@ export class ZenThemeMarketplaceChild extends JSWindowActorChild {
|
||||||
this.sendAsyncMessage("ZenThemeMarketplace:InstallTheme", { theme });
|
this.sendAsyncMessage("ZenThemeMarketplace:InstallTheme", { theme });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getThemeAPIUrl(themeId) {
|
||||||
|
return `https://cdn.jsdelivr.net/gh/zen-browser/theme-store/themes/${themeId}/theme.json`;
|
||||||
|
}
|
||||||
|
|
||||||
async getThemeInfo(themeId) {
|
async getThemeInfo(themeId) {
|
||||||
const url = `https://zen-browser.app/api/get-theme/${themeId}`;
|
const url = this.getThemeAPIUrl(themeId);
|
||||||
console.info("ZTM: Fetching theme info from: ", url);
|
console.info("ZTM: Fetching theme info from: ", url);
|
||||||
const data = await fetch(url, {
|
const data = await fetch(url, {
|
||||||
mode: "no-cors",
|
mode: "no-cors",
|
||||||
|
@ -109,7 +113,7 @@ export class ZenThemeMarketplaceChild extends JSWindowActorChild {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("ZTM: Error parsing theme info: ", e);
|
console.error("ZTM: Error parsing theme info: ", e);
|
||||||
}
|
}
|
||||||
}
|
} else console.log(data.status);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue