Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shutdown attempts to load config.js as an old style module #131

Open
Standard8 opened this issue Sep 23, 2023 · 0 comments
Open

Shutdown attempts to load config.js as an old style module #131

Standard8 opened this issue Sep 23, 2023 · 0 comments

Comments

@Standard8
Copy link

I noticed a use of Cu.import here:

aboutsync/ext_bootstrap.js

Lines 175 to 178 in b4fd012

const { Config } = Cu.import("chrome://aboutsync/content/config.js", {});
Config.finalize();
// And unload it, so changes will get picked up if we reload the addon.
Cu.unload("chrome://aboutsync/content/config.js");

In the startup function, that gets imported as an ES module:

const { Config } = ChromeUtils.importESModule("chrome://aboutsync/content/config.js");

So it looks wrong that it is being treated differently.

Additionally, since ES modules can't be unloaded, it may need to be handled slightly differently. I believe that one workaround has been to use something like ChromeUtils.importESModule("chrome://aboutsync/content/config.js?r=" + Math.rand());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant