Skip to content

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

@Standard8

Description

@Standard8

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());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions