TypeError: can't access property "ownerGlobal", aBrowser is null
Categories
(WebExtensions :: General, defect, P3)
Tracking
(firefox77 affected, firefox78 affected, firefox79 affected)
People
(Reporter: kernp25, Unassigned)
Details
Attachments
(6 files)
I saw this error in the browser console: TypeError: can't access property "ownerGlobal", aBrowser is null
My browser version: 78.0a1 (2020-05-26) (64-Bit)
I'm not sure if this is the same bug, but i have more info.
Comment 2•6 years ago
|
||
Looking at the stack this seems to be called by WebExtension APIs...
The bug seems to only happen with uBlock Origin.
Maybe you have an idea, what is going on?
Updated•6 years ago
|
I have found the problem:
The tab[1] stored in tabToRevokeDuringClearPopup is not cleared when the selected tab[2] is removed.
That's why linkedBrowser [3] is null.
[1] https://searchfox.org/mozilla-central/rev/598e50d2c3cd81cd616654f16af811adceb08f9f/browser/components/extensions/parent/ext-browserAction.js#340
[2] https://searchfox.org/mozilla-central/rev/598e50d2c3cd81cd616654f16af811adceb08f9f/browser/components/extensions/parent/ext-browserAction.js#326
[3] https://searchfox.org/mozilla-central/rev/598e50d2c3cd81cd616654f16af811adceb08f9f/browser/components/extensions/parent/ext-browser.js#1209
Comment 8•6 years ago
|
||
Hello,
I’ve managed to reproduce the error consistently on the latest Nightly (79.0a1/20200609151649), Beta (78.0b4/20200605150717) and Release (77.0.1/20200602222727) under Windows 10 Pro 64-bit and Ubuntu 16.04 LTS.
For this I’ve used the following STR and both uBlock Origin and Tab Unloader add-ons:
- Install uBlock Origin and Tab Unloader
- Make sure only 2 new tabs are open
- Make sure to be on the first tab
- Using Tab Unloader (click on toolbar icon), unload the current tab
- Focus will be moved to the second tab
- Close the first tab
- Hover over the Tab Unloader icon in the toolbar and then over the uBlock Origin icon
- Error appears in browser console
I will also provide a regression range as soon as possible.
Comment 9•6 years ago
|
||
Hello,
I’ve attempted to perform a bisection on the issue and narrowed it down to the following:
- last good build was 2019-03-05
- first bad build was 2019-03-06
However, mozregression seems to stop and is unable to find additional builds to bisect further. Retried several times with the same result.
This is the corresponding pushlog: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=8602628e7edaecadea855a64179b329da6ff1f20&tochange=4ab143dde4dc3424cfedc74b3648fbf2e47fb7bf .
| Reporter | ||
Comment 10•6 years ago
|
||
| Reporter | ||
Comment 11•6 years ago
|
||
Simpler STR:
- Load the add-on in about:debugging
- Open a new tab
- Click on the browser action icon from the installed add-on
- Now close the selected tab
AR:
Every time, when the mouse enters and exits the browser action icon, it will show the "TypeError: can't access property "ownerGlobal", aBrowser is null" error in the browser console.
| Reporter | ||
Comment 12•6 years ago
|
||
Can you confirm the bug with this simpler STR?
Comment 13•6 years ago
|
||
kernp25, if you are able to consistently reproduce, could you use mozregression to find the specific commit?
| Reporter | ||
Comment 14•6 years ago
|
||
Comment 15•6 years ago
|
||
Thanks, that's not surprising. It's not a regression but a bug that existed since the inception of the logic.
| Reporter | ||
Comment 16•6 years ago
|
||
The simple fix is, it should also check here, if linkedBrowser is not null.
What do you think?
Comment 17•6 years ago
|
||
That looks reasonable, plus a test that closes the current tab while it is open, and then checks that tabToRevokeDuringClearPopup is null when the popup is closed after that. To draw inspiration for a unit test, see https://searchfox.org/mozilla-central/rev/25d491b7924493b5d4bedc07841a1cd92f271100/browser/components/extensions/test/browser/browser_ext_browserAction_popup_preload.js#9-148
The new test can be really simple - open a new tab, trigger preloaded popup, verify that tabToRevokeDuringClearPopup matches the tab, close tab, close popup, verify that tabToRevokeDuringClearPopup is null.
@kerp25 This is a good beginner bug. Since you've already figured out the fix, do you want to try to write and submit patch? The tutorial at the WebExtensions Contribution Onramp wiki page has recently been updated to be more explicit about setting up the development environment and submitting a patch, but if there is anything unclear, feel free to ask.
Comment 18•5 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox::Session Restore' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Updated•5 years ago
|
| Reporter | ||
Comment 19•4 years ago
|
||
I think this bug has been fixed by bug 1625593. I can no longer reproduce the bug using the STR from https://bugzilla.mozilla.org/show_bug.cgi?id=1641030#c11.
Comment 20•4 years ago
|
||
Based on code inspection, the issue is still present. The code does not account for the active tab to be closed.
It might be possible to reproduce the bug by pressing the button without releasing the mouse button, and then using a keyboard shortcut to close the current tab.
After releasing the mouse, an error like the originally reported one would appear.
Description
•