Closed Bug 1442900 Opened 7 years ago Closed 7 years ago

Importing embedded JavaScript modules yields NS_NOINTERFACE when loading built web extensions including bundled experiments

Categories

(WebExtensions :: Experiments, defect)

59 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: fwollsen, Unassigned)

Details

Importing embedded JavaScript modules yields NS_NOINTERFACE when loading built web extensions including bundled experiments [Steps to reproduce]: 1. Clone the embedded web extension experiments example at https://github.com/motin/webext-experiment-hello/tree/cu-import-to-embedded-jsm-broken-on-web-ext-build 2. Copy Services.jsm from tree to the extension directory and add a Cu.import to hello.js as per https://github.com/motin/webext-experiment-hello/commit/e4df445779307b9a200baeb200a6f4849b2c1b4d 3. Run the extension using `web-ext run --bc -f nightly` and observe the following expected output: WebExtensions:resourceUrl to embedded Services.jsm: moz-extension://3a9c6db1-c4b5-c344-9cb0-744db1008e7a/Services.jsm hello.js:11 WebExtensions:./Services.jsm loaded: Object { prefs: Getter, appinfo: Getter, dirsvc: Getter, crashmanager: Getter, mm: Getter, ppmm: Getter, io: Getter, appShell: Getter, cache: Getter, cache2: Getter, 38 more… } hello.js:13 hello sez: "Hello, world!" 4. Go to about:debugging and remove the extension automatically installed by web-ext run 5. In another terminal session, build the extension using `web-ext build` 6. Load the recently built zip file into Nightly [Expected result]: - The browser log should display the expected output as per above [Actual result]: - The following error is reported in the browser log: WebExtensions:resourceUrl to embedded Services.jsm: moz-extension://5d265e10-db47-5e4a-9e14-057bd90bd769/Services.jsm hello.js:11 [Exception... "Component returned failure code: 0x80004002 (NS_NOINTERFACE) [nsIXPCComponents_Utils.import]" nsresult: "0x80004002 (NS_NOINTERFACE)" location: "JS frame :: jar:file:///Users/motin/Dev/Projects/mozilla/shield-studies/based-on-webextension-experiments/webext-experiment-hello-embedded-cu-import/extension/web-ext-artifacts/webext-experiment-hello-embedded-cu-import-1.0.zip!/hello.js :: hello :: line 12" data: no] (unknown) Error: An unexpected error occurred undefined [Notes]: The built extension zip has the following file tree when unzipped: . ├── Services.jsm ├── background.js ├── hello.js ├── manifest.json └── schema.json The tree and file contents is identical to the contents of the "extensions" directory.
The module loader does not support moz-extension: URLs, and that isn't going to change.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.