Closed Bug 1532237 Opened 5 years ago Closed 5 years ago

Can't open "event" popup for gmail root element

Categories

(DevTools :: Inspector, defect)

defect
Not set
normal

Tracking

(firefox-esr60 unaffected, firefox65 unaffected, firefox66 unaffected, firefox67 fixed)

RESOLVED FIXED
Firefox 67
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:

  1. yesterday's (march 3, 2019) nightly (on mac, in case it matters)
  2. open gmail and log in
  3. open inspector
  4. 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.

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

It works on the <body> node's {event} bubble, so it seems specific to the root element, but I don't know why.

Thanks for filing. I think Mike would probably be able to investigate and report here what's going wrong. CCing him here.

FWIW, this works on beta so I can only assume it regressed sometime in the 67 cycle.

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

Blocks: 1517210
Has Regression Range: --- → yes
Has STR: --- → yes

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: nobody → poirot.alex

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.

Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c7cfa9240f33
Use a Debugger loaded in a distinct compartment when debugging chrome in the event collector codebase. r=miker
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 67
Blocks: 1539453
Whiteboard: [qa-67b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: