Discarded hidden tab's URL is "about:blank" after moving the tab to a new window
Categories
(WebExtensions :: General, defect, P3)
Tracking
(firefox89 fixed)
Tracking | Status | |
---|---|---|
firefox89 | --- | fixed |
People
(Reporter: robwu, Assigned: robwu)
References
Details
Attachments
(2 files)
See:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1694699#c23
- https://bugzilla.mozilla.org/show_bug.cgi?id=1694699#c21
STR:
- Install the attached extension at
about:debugging
- Follow all steps starting from step 2 at https://bugzilla.mozilla.org/show_bug.cgi?id=1694699#c20 . The expectation and actual behavior is identical.
This is not a recent regression (unlike that other bug).
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
The relevant stack trace is at https://bugzilla.mozilla.org/show_bug.cgi?id=1694699#c21
This bug happens because hideTab
is called as part of the tab adoption in a new window (<browser>
from old to new window) at https://searchfox.org/mozilla-central/rev/2b99ea2e97eef00a8a1c7e24e5fe51ab5304bc42/browser/components/sessionstore/SessionStore.jsm#4477-4491
... but before the tab's URL was restored several lines later, at https://searchfox.org/mozilla-central/rev/2b99ea2e97eef00a8a1c7e24e5fe51ab5304bc42/browser/components/sessionstore/SessionStore.jsm#4565,4604-4622
Consequently, when browser.currentURI
is accessed, the incorrect (about:blank
) URL is used.
To fix this in extension code, I suggest that we ignore tabs that are being adopted. To fix this more generally, the tabData should be restored as much as possible before methods are called that may invoke external callers. The latter will also fix the extension-specific case.
Assignee | ||
Comment 2•4 years ago
|
||
swapBrowsersAndCloseOther
calls SessionStore.setTabState
, but the
latter may trigger several tab events before the tab has fully been
restored. This results in duplicate tabs.onUpdated events and in
unexpected access to properties of the tab/browser (which in turn
triggers the reported bug).
Fix this specific case by ignoring events that happen while the tab is
amidst a restoration.
Comment 4•4 years ago
|
||
bugherder |
Description
•