Can't open "event" popup for gmail root element
Categories
(DevTools :: Inspector, defect)
Tracking
(firefox-esr60 unaffected, firefox65 unaffected, firefox66 unaffected, firefox67 fixed)
Tracking | Status | |
---|---|---|
firefox-esr60 | --- | unaffected |
firefox65 | --- | unaffected |
firefox66 | --- | unaffected |
firefox67 | --- | fixed |
People
(Reporter: Gijs, Assigned: ochameau)
References
Details
(Keywords: regression, Whiteboard: [qa-67b-p2])
Attachments
(1 file)
STR:
- yesterday's (march 3, 2019) nightly (on mac, in case it matters)
- open gmail and log in
- open inspector
- click {event} bubble next to <html>
ER:
list of events with event listeners pops up
AR:
nothing happens.
I'm seeing errors in the browser console:
uncaught exception: Protocol error (unknownError): debugger and debuggee must be in different compartments
but I don't know if they're related or not.
Reporter | ||
Comment 1•6 years ago
|
||
Oh, some more error output:
Error while calling actor 'domnode's method 'getEventListenerInfo' debugger and debuggee must be in different compartments protocol.js:1042:13
writeError resource://devtools/shared/protocol.js:1042
handler resource://devtools/shared/protocol.js:1226
handler resource://devtools/shared/protocol.js:1226
_queueResponse resource://devtools/shared/protocol.js:1056
handler resource://devtools/shared/protocol.js:1225
onPacket resource://devtools/server/main.js:1291
receiveMessage resource://devtools/shared/transport/child-transport.js:66
_addListener resource://devtools/shared/transport/child-transport.js:40
ready resource://devtools/shared/transport/child-transport.js:57
_onConnection resource://devtools/server/main.js:880
connectToParent resource://devtools/server/main.js:296
onConnect resource://devtools/server/startup/frame.js:59
makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:109
<anonymous> resource://devtools/server/startup/frame.js:80
<anonymous> resource://devtools/server/startup/frame.js:160
processHandlerForEvent@resource://devtools/server/actors/inspector/event-collector.js:825:22
getEventListeners@resource://devtools/server/actors/inspector/event-collector.js:778:14
getEventListeners@resource://devtools/server/actors/inspector/node.js:332:33
getEventListenerInfo@resource://devtools/server/actors/inspector/node.js:444:17
handler@resource://devtools/shared/protocol.js:1189:37
onPacket@resource://devtools/server/main.js:1291:58
receiveMessage@resource://devtools/shared/transport/child-transport.js:66:16
MessageListener.receiveMessage*_addListener@resource://devtools/shared/transport/child-transport.js:40:14
ready@resource://devtools/shared/transport/child-transport.js:57:10
_onConnection@resource://devtools/server/main.js:880:15
connectToParent@resource://devtools/server/main.js:296:17
onConnect<@resource://devtools/server/startup/frame.js:59:35
exports.makeInfallible/<@resource://devtools/shared/ThreadSafeDevToolsUtils.js:109:22
MessageListener.receiveMessage*@resource://devtools/server/startup/frame.js:80:5
@resource://devtools/server/startup/frame.js:160:5
protocol.js:1045:15
Reporter | ||
Comment 2•6 years ago
|
||
It works on the <body> node's {event} bubble, so it seems specific to the root element, but I don't know why.
Comment 3•6 years ago
|
||
Thanks for filing. I think Mike would probably be able to investigate and report here what's going wrong. CCing him here.
Reporter | ||
Comment 4•6 years ago
|
||
FWIW, this works on beta so I can only assume it regressed sometime in the 67 cycle.
![]() |
||
Comment 5•6 years ago
|
||
Regresdion window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=9450c39ec2054a0581d240e49be4917cd454fd4c&tochange=191a7f8a281643ba59e6581f5e8ddb7f5222cb37
Regressed by: 191a7f8a2816 Alexandre Poirot — Bug 1517210 - Stop always loading DevTools modules in fresh compartments. r=jandem,nchevobbe
![]() |
||
Updated•6 years ago
|
Assignee | ||
Comment 6•6 years ago
|
||
Note that the failure only happens with devtools.chrome.enabled pref set to true, which we automatically do in local builds.
The throwing code is this one:
https://searchfox.org/mozilla-central/rev/92d11a33250a8e368c8ca3e962e15ca67117f765/devtools/server/actors/inspector/event-collector.js#822-825
const global = Cu.getGlobalForObject(handler);
// It is important that we recreate the globalDO for each handler because
// their global object can vary e.g. resource:// URLs on a video control. If
// we don't do this then all chrome listeners simply display "native code."
globalDO = dbg.addDebuggee(global);
The dbg
is created like this:
https://searchfox.org/mozilla-central/rev/92d11a33250a8e368c8ca3e962e15ca67117f765/devtools/server/actors/inspector/event-collector.js#765
const dbg = new Debugger();
It looks like we are missing a test asserting the behavior of chrome event listeners.
Then on how to address this issue, we could:
- ensure loading the whole server in a distinct compartment when the pref is turned on, but that would slow down the devtools for all local builds.
- given that the
Debugger
involved here is only used for inspection and is not registering any callback, I think it is safe to workaround this exception by only loading Debugger in a distinct compartment and only the Debugger used by event collector.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 7•6 years ago
|
||
Now that the server is by default loaded in the shared system compartment,
we have to special cases the code debugging system compartments.
When devtools.chrome.enabled is turned on, the event collector is
inspecting the system compartment's event listener.
In this case, we are using a special Debugger instance loaded in
a sandbox flagged with invisibleToDebugger=true. This forces loading it
in a distinct compartment and helps the debugger know about the boundaries
between debugger and debuggee code.
It should be safe to only load the Debugger and not the whole server here
as event collector is only inspecting and doesn't register any callback on
the Debugger API.
Comment 9•6 years ago
|
||
bugherder |
Updated•6 years ago
|
Updated•6 years ago
|
Description
•