Open Bug 1641030 Opened 6 years ago Updated 4 years ago

TypeError: can't access property "ownerGlobal", aBrowser is null

Categories

(WebExtensions :: General, defect, P3)

defect

Tracking

(firefox77 affected, firefox78 affected, firefox79 affected)

Tracking Status
firefox77 --- affected
firefox78 --- affected
firefox79 --- affected

People

(Reporter: kernp25, Unassigned)

Details

Attachments

(6 files)

Attached image screenshot_1.png

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.

Flags: needinfo?(jhofmann)
Attached image screenshot_2.png

Looking at the stack this seems to be called by WebExtension APIs...

Component: Private Browsing → Untriaged
Flags: needinfo?(jhofmann)
Product: Firefox → WebExtensions
Attached video JXGTpOElk5.mp4

The bug seems to only happen with uBlock Origin.

Maybe you have an idea, what is going on?

Flags: needinfo?(rob)
Attached image firefox_Wx6T6oSPLy.png

New screenshot of the error.

Severity: -- → S3
Priority: -- → P3
Attached video 3Up8wJuXWf.mp4

How to reproduce the bug.

Can you confirm?

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:

  1. Install uBlock Origin and Tab Unloader
  2. Make sure only 2 new tabs are open
  3. Make sure to be on the first tab
  4. Using Tab Unloader (click on toolbar icon), unload the current tab
  5. Focus will be moved to the second tab
  6. Close the first tab
  7. Hover over the Tab Unloader icon in the toolbar and then over the uBlock Origin icon
  8. Error appears in browser console

I will also provide a regression range as soon as possible.

Status: UNCONFIRMED → NEW
Has STR: --- → yes
Ever confirmed: true

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 .

Attached file manifest.zip

Simpler STR:

  1. Load the add-on in about:debugging
  2. Open a new tab
  3. Click on the browser action icon from the installed add-on
  4. 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.

Can you confirm the bug with this simpler STR?

Flags: needinfo?(rob) → needinfo?(alexandru.cornestean)

kernp25, if you are able to consistently reproduce, could you use mozregression to find the specific commit?

Thanks, that's not surprising. It's not a regression but a bug that existed since the inception of the logic.

Flags: needinfo?(alexandru.cornestean)

The simple fix is, it should also check here, if linkedBrowser is not null.

What do you think?

Flags: needinfo?(rob)

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.

Flags: needinfo?(rob)

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.

Component: Untriaged → Session Restore
Product: WebExtensions → Firefox
Component: Session Restore → General
Product: Firefox → WebExtensions

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.

Flags: needinfo?(rob)

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.

Flags: needinfo?(rob)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: