Compare commits

...
Sign in to create a new pull request.

4 commits

Author SHA1 Message Date
buzz-lightsnack-2007
d185b20a14 merge the improved empty source data handling to the Firefox version 2024-05-01 17:00:17 +08:00
buzz-lightsnack-2007
1e318787da mitigate https://bugzilla.mozilla.org/show_bug.cgi?id=1784446 2024-05-01 16:55:11 +08:00
buzz-lightsnack-2007
e7677284bf use async imports since ES6 imports not available without service workers 2024-05-01 16:54:43 +08:00
buzz-lightsnack-2007
a013bb1ccf modified manifest to support Firefox 2024-05-01 16:53:44 +08:00
3 changed files with 22 additions and 12 deletions

View file

@ -7,7 +7,7 @@
"permissions": ["tabs", "storage", "unlimitedStorage", "contextMenus"], "permissions": ["tabs", "storage", "unlimitedStorage", "contextMenus"],
"background": { "background": {
"service_worker": "scripts/background/shopAI.js", "type": "module" "scripts": ["scripts/background/shopAI.js"]
}, },
"action": {}, "action": {},
"content_scripts": [ "content_scripts": [
@ -27,8 +27,16 @@
"1024": "media/icons/logo.png", "1024": "media/icons/logo.png",
"512": "media/icons/logo_tiny.png" "512": "media/icons/logo_tiny.png"
}, },
"options_page": "pages/settings.htm", "options_ui": {
"page": "pages/settings.htm"
},
"browser_specific_settings": {
"gecko": {
"id": "{db2d6746-5711-4c83-90c7-107057f37732}"
}
},
"default_locale": "en" "default_locale": "en"
} }

View file

@ -2,10 +2,12 @@
Shop wisely with AI! Shop wisely with AI!
*/ */
import fc from './fc.js'; (async () => {
import BackgroundCheck from "./background.check.js"; const fc = (await import(browser.runtime.getURL("scripts/external/watch.js"))).default;
import BackgroundMessaging from "./background.messaging.js"; const BackgroundCheck = (await import(browser.runtime.getURL("/scripts/background/background.check.js"))).default;
const BackgroundMessaging = (await import(browser.runtime.getURL("/scripts/background/background.messaging.js"))).default;
fc.run();
BackgroundCheck.init(); fc.run();
new BackgroundMessaging(); BackgroundCheck.init();
new BackgroundMessaging();
})

View file

@ -78,8 +78,8 @@ class global {
// Override the data with managed data if available. // Override the data with managed data if available.
if ((NAME != null) ? NAME.length : false) { if ((NAME != null) ? NAME.length : false) {
DATA[`managed`] = await managed.read((NAME) ? [...NAME] : null); // DATA[`managed`] = await managed.read((NAME) ? [...NAME] : null);
DATA_RETURNED[`value`] = (DATA[`managed`] != null) ? DATA[`managed`] : DATA_RETURNED[`value`]; // DATA_RETURNED[`value`] = (DATA[`managed`] != null) ? DATA[`managed`] : DATA_RETURNED[`value`];
}; };
return DATA_RETURNED[`value`]; return DATA_RETURNED[`value`];