diff --git a/extension/README.md b/extension/README.md index d981d51..2059e78 100644 --- a/extension/README.md +++ b/extension/README.md @@ -10,4 +10,4 @@ bringing all your favourite notion-enhancer features to the browser (wip) > > i'll be building the enhancer chrome-first from now on, since it'll be more limited there (and it's easier to add extra features when porting than to take features out), and then releasing the app loader a little afterwards. both the app loader and the chrome extension will source the same themes & extensions from the mod repository, and updates & releases of individual mods won't require waiting for the enhancer version anymore. -- from the #announcements channel of the [notion-enhancer discord](https://discord.gg/sFWPXtA) +-- from the #announcements channel of the [notion-enhancer discord](https://discord.gg/sFWPXtA) diff --git a/extension/manifest.json b/extension/manifest.json index 1bd7eff..131c7b2 100644 --- a/extension/manifest.json +++ b/extension/manifest.json @@ -12,7 +12,7 @@ }, "manifest_version": 3, "background": { - "service_worker": "src/worker.js" + "service_worker": "worker.js" }, "action": { "default_popup": "src/gui.html" diff --git a/extension/registry.json b/extension/registry.json index a2d7e54..27c16db 100644 --- a/extension/registry.json +++ b/extension/registry.json @@ -1 +1 @@ -[{"name":"theming","id":"0f0bf8b6-eae6-4273-b307-8fc43f2ee082","description":"the default theme variables, required by other themes & extensions.","version":"0.11.0","tags":["core","theme"],"authors":[{"name":"dragonwocky","email":"thedragonring.bod@gmail.com","url":"https://dragonwocky.me/","icon":"https://dragonwocky.me/avatar.jpg"}],"css":{"client":["client.css"]},"dir":"theming@0f0bf8b6-eae6-4273-b307-8fc43f2ee082","js":{}}] \ No newline at end of file +[{"name":"theming","id":"0f0bf8b6-eae6-4273-b307-8fc43f2ee082","description":"the default theme variables, required by other themes & extensions.","version":"0.11.0","tags":["core","theme"],"authors":[{"name":"dragonwocky","email":"thedragonring.bod@gmail.com","url":"https://dragonwocky.me/","icon":"https://dragonwocky.me/avatar.jpg"}],"css":{"client":["client.css"]},"js":{"client":["test.js"]},"dir":"theming@0f0bf8b6-eae6-4273-b307-8fc43f2ee082"}] \ No newline at end of file diff --git a/extension/_scan.js b/extension/scan.js similarity index 100% rename from extension/_scan.js rename to extension/scan.js diff --git a/extension/src/helpers.js b/extension/src/helpers.js index 37c7867..fb8809c 100644 --- a/extension/src/helpers.js +++ b/extension/src/helpers.js @@ -6,7 +6,7 @@ 'use strict'; -const registry = fetch(chrome.runtime.getURL('registry.json')).then((response) => +const registry = fetch(chrome.runtime.getURL('/registry.json')).then((response) => response.json() ); diff --git a/extension/src/launcher.js b/extension/src/launcher.js index b476082..823042c 100644 --- a/extension/src/launcher.js +++ b/extension/src/launcher.js @@ -14,6 +14,9 @@ export default async () => { for (let sheet of mod.css?.client || []) { web.loadStyleset(`repo/${mod.dir}/${sheet}`); } + for (let script of mod.js?.client || []) { + import(chrome.runtime.getURL(`repo/${mod.dir}/${script}`)); + } } }); }; diff --git a/extension/src/worker.js b/extension/worker.js similarity index 91% rename from extension/src/worker.js rename to extension/worker.js index 2d41dc9..2b07ef6 100644 --- a/extension/src/worker.js +++ b/extension/worker.js @@ -3,5 +3,3 @@ * (c) 2021 dragonwocky (https://dragonwocky.me/) * (https://notion-enhancer.github.io/) under the MIT license */ - -'use strict';