Closed Bug 1626526 Opened 4 years ago Closed 4 years ago

TypeError: can't access property "spec", topFrame.currentURI is null: _onRequest@chrome://remote/content/domains/parent/Network.jsm:383:20

Categories

(Remote Protocol :: CDP, defect, P1)

defect

Tracking

(firefox76 fixed)

RESOLVED FIXED
Firefox 76
Tracking Status
firefox76 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

Details

Attachments

(1 file)

This fails a lot in Puppeteer unit tests, and I wonder how many test failures it actually produces. Here the exact failure:

[task 2020-04-01T05:21:34.524Z] PID 91 |   TypeError: can't access property "spec", topFrame.currentURI is null: _onRequest@chrome://remote/content/domains/parent/Network.jsm:383:20
[task 2020-04-01T05:21:34.524Z] PID 91 | emit@resource://gre/modules/EventEmitter.jsm:160:20
[task 2020-04-01T05:21:34.525Z] PID 91 | _onRequest@chrome://remote/content/domains/parent/network/NetworkObserver.jsm:281:10

The appropriate source is here:

https://searchfox.org/mozilla-central/rev/fa2df28a49883612bd7af4dacd80cdfedcccd2f6/remote/domains/parent/Network.jsm#383

As it looks like the object as returned by getLoadContext(httpChannel) doesn't have a topFrameElement property. Note that this method also has a duplicate in NetworkObserver.jsm.

This is actually not causing test failures, but is all related to network requests not initiated by the target, but the browser itself. And for all the cases I have seen so far this is for the favicon.ico file.

So _onRequest in NetworkObserver.jsm has to return early if there is no valid URI for the topFrameElement. Also we should not send Network.requestWillBeSent events for these kind of network requests given that Chrome is also not doing that.

The latter proposal seems to be harder to manage and would need a bit of refactoring of the network event code. I would propose to just get rid of the failure for now so that we have cleaner Puppeteer logs.

Assignee: nobody → hskupin
Status: NEW → ASSIGNED
Priority: P2 → P1
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f554112cb7bd
[remote] Don't emit internal network request events for invalid top frame elements. r=remote-protocol-reviewers,maja_zf
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 76
Component: CDP: Network → CDP
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: