-
Notifications
You must be signed in to change notification settings - Fork 263
Bug 685564 - Make page-mod work on Firefox mobile #310
Conversation
assert.deepEqual({foo:1}, {foo:1, bar:2}); works as expected, and returns `false`.
- Added documentation page for Message Manager - Fixed some issues in Message Manager
const {Namespace: NS} = require("./namespace"); | ||
|
||
const scriptLoader = Cc["@mozilla.org/moz/jssubscript-loader;1"]. | ||
getService(Ci.mozIJSSubScriptLoader); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ZER0 sandbox manipulation low level API has landed to master recently, could you please use that instead of direct use of mozIJSSubScriptLoader
and Cu.Sandbox
?
console.exception(e); | ||
} | ||
} else { | ||
scriptLoader.loadSubScript(uri, sandbox); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wanted to mention that sandbox API uses loadSubScript
with third argument 'UTF-8', cause otherwise complex unicode chars are not handled properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we discussed in IRC, I merged this code with load
function of sandbox
module.
It feels to me that |
I don't consider any of my comments to be critical or blocking this from landing, as they can be addressed in a follow up patch. In such case could you please fill a bug report for that and CC me there. |
// `Namespace` is a e4x function in the scope, so we import the function as `NS` | ||
// to avoid clashing, until we don't have a better candidate to replace | ||
// `Namespace` in namespace module. | ||
const {Namespace: NS} = require("./namespace"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: according to the convention it shoud be (spaces between curlyies) :
const { Namespace: NS } = require("./namespace");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have used ns
as an alias instead, and I think I saw Alex used something else. I'd suggest export ns
from namespace module as an alias to Namespace
and put the comment regarding e4x conflict there.
|
||
let sandbox = Cu.Sandbox(systemPrincipal, { wantXrays : false }); | ||
|
||
Object.defineProperties(sandbox, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should probably use merge:
merge(sandbox, {
addMessageListener: addMessageListener.bind(sandbox),
....
})
It will methods configurable & writable, but they are in normal massegaManager anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't have hard feeling about it, I'd like to keep the descriptors.
@Gozala about the overlap with |
…de followed the review suggestions.
For more details, see:
https://bugzilla.mozilla.org/show_bug.cgi?id=685564