refactor: Add lazy loading for images in ZenThemeMarketplaceParent.sys.mjs

Improve page load performance by adding lazy loading for images in the ZenThemeMarketplaceParent.sys.mjs file. The code now downloads the preferences.json file if it exists in the theme object. This enhancement optimizes the loading of images and improves the overall user experience.
This commit is contained in:
Mauro Balades 2024-08-17 17:07:02 +02:00
parent ae03ba527a
commit 7617286d3e

View file

@ -70,6 +70,9 @@ export class ZenThemeMarketplaceParent extends JSWindowActorParent {
await IOUtils.makeDirectory(themePath, { ignoreExisting: true });
await this.downloadUrlToFile(theme.style, PathUtils.join(themePath, "chrome.css"));
await this.downloadUrlToFile(theme.readme, PathUtils.join(themePath, "readme.md"));
if (theme.preferences) {
await this.downloadUrlToFile(theme.preferences, PathUtils.join(themePath, "preferences.json"));
}
}
get themesRootPath() {