Closed Bug 1728974 Opened 3 years ago Closed 3 years ago

TypeError: can't access property "browserId", topFrame.browsingContext is null

Categories

(DevTools :: General, defect, P3)

defect

Tracking

(firefox94 fixed)

RESOLVED FIXED
94 Branch
Tracking Status
firefox94 --- fixed

People

(Reporter: robwu, Assigned: ochameau)

Details

Attachments

(1 file)

I see this error very often in my browser console:

TypeError: can't access property "browserId", topFrame.browsingContext is null
    matchRequest resource://devtools/server/actors/network-monitor/network-observer.js:126
    _httpResponseExaminer resource://devtools/server/actors/network-monitor/network-observer.js:450
    makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103

Error reported by:

ThreadSafeDevToolsUtils.js:82:13
    reportException resource://devtools/shared/ThreadSafeDevToolsUtils.js:82
    makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:109

I don't know how exactly it happened, but I can tell that I open the developer tools very often (tab's devtools, extension debugger, Browser Toolbox, Browser Content Toolbox, Browser Console).

The error is thrown from https://searchfox.org/mozilla-central/rev/55e8eba74b60b92d04b781f7928f54ef76b13fa9/devtools/server/actors/network-monitor/network-observer.js#126

It looks like the browsingContext attribute may be null:
https://searchfox.org/mozilla-central/rev/55e8eba74b60b92d04b781f7928f54ef76b13fa9/dom/webidl/MozFrameLoaderOwner.webidl#35
https://searchfox.org/mozilla-central/rev/55e8eba74b60b92d04b781f7928f54ef76b13fa9/dom/base/nsFrameLoaderOwner.cpp#42-47

... so a fix could be to replace topFrame.browsingContext.browserId with topFrame.browsingContext?.browserId

Thanks for filing, let's apply the suggestion

Assignee: nobody → poirot.alex
Severity: -- → S3
Status: NEW → ASSIGNED
Priority: -- → P3

This doesn't reproduce easily. But you may see that while closing a youtube page
while having the browser console opened.

Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f050e5cd7e81
[devtools] Avoid exceptions when processing requests of tabs being closed. r=bomsy
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: