Closed Bug 1583117 Opened 4 months ago Closed 3 months ago

Markup view is blank if an error is thrown gathering event listeners

Categories

(DevTools :: Inspector, defect, P2)

69 Branch
defect

Tracking

(firefox71 fixed)

RESOLVED FIXED
Firefox 71
Tracking Status
firefox71 --- fixed

People

(Reporter: thededem, Assigned: miker, NeedInfo)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0

Steps to reproduce:

Open the inspector on a website and selectet an element on the website for inspection.

I use the current version of firefox (69.0.1) on Windows 10.

Actual results:

The inspector body is blank. It shows "HTML durchsuchen" ("Search HTML") but not any actual HTML.
This behaviour is limited only to the website I am currently working on and which is unfortunately not available to the public (which makes reproducing this very hard, I guess).
However, when loading the website with the inspector being open, the console shows the following output:

Error writing response to: querySelector Actor.js:166:21
Error while calling actor 'domwalker's method 'querySelector' Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXPCComponents_Utils.getObjectPrincipal] Actor.js:91:13
isChromeHandler@resource://devtools/server/actors/inspector/event-collector.js:307:33
getListeners@resource://devtools/server/actors/inspector/event-collector.js:468:45
hasListeners@resource://devtools/server/actors/inspector/event-collector.js:228:17
hasEventListeners@resource://devtools/server/actors/inspector/event-collector.js:797:21
get _hasEventListeners@resource://devtools/server/actors/inspector/node.js:433:33
form@resource://devtools/server/actors/inspector/node.js:259:7
write@resource://devtools/shared/protocol/types.js:355:32
types.addArrayType/write/<@resource://devtools/shared/protocol/types.js:220:33
write@resource://devtools/shared/protocol/types.js:220:16
write@resource://devtools/shared/protocol/types.js:268:39
write@resource://devtools/shared/protocol/Response.js:98:22
write@resource://devtools/shared/protocol/Response.js:43:28
sendReturn@resource://devtools/shared/protocol/Actor.js:164:38
Actor.js:96:15
Protocol error (unknownError): Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXPCComponents_Utils.getObjectPrincipal] inspector.js:326:15
Got a mutation for an unexpected actor: server1.conn7.child1/domnode80, please file a bug on bugzilla.mozilla.org! inspector.js:296:19
console.trace() inspector.js:301:19
getMutations resource://devtools/shared/fronts/inspector.js:301

When opening the inspector on the website and selecting an element, the console shows the following errors:

Error writing response to: querySelector Actor.js:166:21
Error while calling actor 'domwalker's method 'querySelector' Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXPCComponents_Utils.getObjectPrincipal] Actor.js:91:13
isChromeHandler@resource://devtools/server/actors/inspector/event-collector.js:307:33
getListeners@resource://devtools/server/actors/inspector/event-collector.js:468:45
hasListeners@resource://devtools/server/actors/inspector/event-collector.js:228:17
hasEventListeners@resource://devtools/server/actors/inspector/event-collector.js:797:21
get _hasEventListeners@resource://devtools/server/actors/inspector/node.js:433:33
form@resource://devtools/server/actors/inspector/node.js:259:7
write@resource://devtools/shared/protocol/types.js:355:32
types.addArrayType/write/<@resource://devtools/shared/protocol/types.js:220:33
write@resource://devtools/shared/protocol/types.js:220:16
write@resource://devtools/shared/protocol/types.js:268:39
write@resource://devtools/shared/protocol/Response.js:98:22
write@resource://devtools/shared/protocol/Response.js:43:28
sendReturn@resource://devtools/shared/protocol/Actor.js:164:38
Actor.js:96:15
Protocol error (unknownError): Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXPCComponents_Utils.getObjectPrincipal] inspector.js:326:15
TypeError: "this.getContainer(...) is undefined"
maybeNavigateToNewSelection resource://devtools/client/inspector/markup/markup.js:844
onShow resource://devtools/client/inspector/markup/markup.js:810
process resource://gre/modules/Promise-backend.js:961
walkerLoop resource://gre/modules/Promise-backend.js:845
scheduleWalkerLoop resource://gre/modules/Promise-backend.js:778
markup.js:275:15

Expected results:

The inspector should show the HTML of the current site/the selected item.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Inspector
Product: Firefox → DevTools

@thededem Could you try to produce a test case? It looks like we are trying to get some jQuery event listeners from the page and throw a security error.

It would also be useful if you could let us know which version of jQuery you are using.

Assignee: nobody → mratcliffe
Flags: needinfo?(thededem)
Priority: -- → P2

We don't have a test case but this is a genuine error that needs to be fixed.

From the error stack it is clear that this is throwing NS_ERROR_ILLEGAL_VALUE when we call Cu.getObjectPrincipal(handler).

Although an error is thrown here it shouldn't break the markup view so let's catch the error and allow the markup view to continue.

Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
OS: Unspecified → All
Hardware: Unspecified → All
Summary: Inspector body is blank → Markup view is blank if an error is thrown gathering event listeners
Pushed by mratcliffe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cbf93a9af502
Markup view is blank if an error is thrown gathering event listeners r=pbro
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 71
You need to log in before you can comment on or make changes to this bug.