You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.
"type": "privileged",
"permissions": {
"mobilenetwork": { "description":"Obtain information from the device about cell ID." },
"systemXHR": { "description":"Update OpenCellID.org using data connection." },
"geolocation": { "description":"Obtain geolocation from the device GPS." }
}
The Simulator reports an error:
Unknown permission 'mobilenetwork'.
Trying (without really knowing what I'm doing) to diagnose, I find that it is resources/r2d2b2g/lib/validator.js that does the validation of the manifest.
This script loads the list of valid permissions from resource://gre/modules/PermissionsTable.jsm
When I open that URI in Firefox, the "mobilenetwork" permission is not listed.
However, in the file included with the Simulator extension:
@reinvented Thanks for the detailed and comprehensive bug report!
When @rpl initially implemented manifest validation, in #323, he pushed the manifest from Firefox to B2G for validation using B2G's PermissionsTable.jsm, which knows about the "mobilenetwork" permission. But @ochameau later changed the validator to use Firefox's version of that file in order to simplify the validation flow, and it looks like that's the cause of this bug.
I'm not sure what the best solution is. We could switch back to validating in B2G, which would solve this problem at the cost of re-complicating the validation flow. Or perhaps we could load B2G's PermissionsTable.jsm in Firefox somehow (f.e. by generating a file: URL to it and then loading it via Cu.import).
Reporting an issue discussed at some length in mozilla.dev.webapps
Trying to run an app that requests the "mobilenetwork" permission:
https://github.com/reinvented/getcellid/tree/mobilenetwork/www
The manifest.webapp looks, in part, like this:
The Simulator reports an error:
Trying (without really knowing what I'm doing) to diagnose, I find that it is
resources/r2d2b2g/lib/validator.js
that does the validation of the manifest.This script loads the list of valid permissions from
resource://gre/modules/PermissionsTable.jsm
When I open that URI in Firefox, the "mobilenetwork" permission is not listed.
However, in the file included with the Simulator extension:
resources/r2d2b2g/data/mac64/B2G.app/Contents/MacOS/modules/PermissionsTable.jsm
the "mobilenetwork" permission is listed.
Opening the URI
resource://gre/modules/
in Firefox I see:Index of jar:file:///Applications/Firefox.app/Contents/MacOS/omni.ja!/modules/
at the top of the page, which makes me think that perhaps the
validator.js
is getting itsPermissionsTable.jsm
from the wrong place?The text was updated successfully, but these errors were encountered: