[Add-ons] Error occurred when calling chrome.runtime.getManifest()

NEW
Unassigned

Status

Firefox OS
Runtime
2 years ago
2 years ago

People

(Reporter: elin, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
Hi,


When I tried to call chrome.runtime.getManifest() in my Firefox OS add-on,
an error occurred, the stacktrace is as below:

TypeError: context is undefined
Stack trace:
api/<.runtime.getManifest@resource://gre/modules/ExtensionContent.jsm:64:7
initialize@app://fa188ee8-9285-564d-99b0-5314c9ecf40e/index.js:176:19
@app://fa188ee8-9285-564d-99b0-5314c9ecf40e/index.js:13:5
@app://fa188ee8-9285-564d-99b0-5314c9ecf40e/index.js:3:1
WebappsActor.prototype.getIconAsDataURL/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/server/actors/webapps.js:836:9
Handler.prototype.process@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/Promise-backend.js:934:23
this.PromiseWalker.walkerLoop@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/Promise-backend.js:813:7
this.PromiseWalker.scheduleWalkerLoop/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/Promise-backend.js:747:1
Can you attach a test add-on?

Your stack seems to come from the webide extension installation. Does that also reproduce after a normal restart?
(Reporter)

Comment 2

2 years ago
Yes, I install the add-on via WebIDE on Firefox Nightly,
I haven't try it after a normal restart, will update in comment when I do.

BTW I'm testing chrome.runtime.getManifest() after this line:
https://github.com/elin-moco/fxos-addon-draggable-home-btn/blob/master/index.js#L174
which is the end of the initialization function,
chrome.extension.getURL() works well there, 
thinking maybe the timing is too early for getManifest()?

I'll try tomorrow when I get to access my device.
(Reporter)

Comment 3

2 years ago
Hi,


To make things simpler,
I created an add-on based on the simple-addon example to test chrome.runtime.getManifest()
https://github.com/elin-moco/simple-addon/tree/get-manifest-error

the getManifest() call is fired when the black block on the screen clicked.
And currently it shows error, and the error still occurs after a clean restart.
Blocks: 1229771
Component: General → Runtime
You need to log in before you can comment on or make changes to this bug.