Le 05/06/2013 20:04, Dietrich Ayala a �crit :
Oh yes, I was missing that, thanks!
But that's insufficient. Or it's sufficient, but not in the right place.
"require" and Chrome privileges are available only in the add-on
process. But I wish to "apply" the debugger to the content global.
In the script I run from Chrome-enabled scratchpad, I wrote:
var win = gBrowser.selectedBrowser.contentWindow;
var dbg = new Debugger(win);
And I'm under the impression that Jetpack doesn't provide access to
gBrowser.selectedBrowser. Maybe the whole process isolation thing. But
in my case, I need to be plugged directly to the content global.
If I recall correctly, the Debugger API adds its stack frames to the
stack of the content effectively running "on top of" content, so it
requires some intimacy between the content and the Debugger API. For
that reason, I feel the Debugger API needs to be available in the
content process.
It seems counter-intention to ask for the content window to be available
in the add-on process. However, would it be possible to make the
Debugger API available in the content part of addons?
Maybe after an opt-in to pagemod? Or as an undocumented feature? :-)
pageMod.PageMod({
include: "*",
superPower: {
debugger: true
}
contentScript: "/*some code using Debugger*/"
});
I realize this goes a bit against the intention of separating
privileges, but I can't find a better idea to make have the Debugger API
work with Jetpack.
Thanks,
David