Updated "title" is not notified via "tabs.onUpdated" listeners for a tab recycled by "about:sessionrestore"
Categories
(WebExtensions :: General, defect, P5)
Tracking
(Not tracked)
People
(Reporter: yuki, Unassigned)
Details
Attachments
(2 files)
553 bytes,
application/x-xpinstall
|
Details | |
1.69 KB,
patch
|
Details | Diff | Splinter Review |
"about:sessionrestore" tab after crash tries to recycle the tab and the window if the window has only the tab, but the title of the restored page loaded into the recycled tab won't be notified to tabs.onUpdated
listeners. This was originally reported to Tree Style Tab's issue tracker.
Steps to reproduce
- Start Firefox with a clean profile.
- Open two or more tabs with arbitrary webpages.
- Kill the process of Firefox. For example. if you use Windows 10:
Ctrl-Shift-ESC
=> click "More details" (this step is required!)
=> right click on the "Firefox"
=> "End task" - Start Firefox again.
- All tabs are restored automatically, then click other tabs to load them.
- Kill the process of Firefox again with the method same to the step 3.
- Start Firefox again.
- Then you'll see "about:sessionrestore" tab. Don't touch it here.
- Open a new Firefox window with Ctrl-N.
- Load "about:debugging".
- Choose "This Nightly".
- Click "Load Temporary Add-on...".
- Choose the attached XPI "testcase.xpi". It contains following files:
manifest.json:
{
"manifest_version": 2,
"name": "tstcase",
"version": "1.0",
"author": "YUKI \"Piro\" Hiroshi",
"description": "testcase",
"permissions": [
"tabs"
],
"background": {
"scripts": [
"background.js"
]
}
}
background.js:
browser.tabs.onUpdated.addListener(
(tabId, change, tab) => console.log(tabId, change),
{ properties: ["title"] }
);
- Close the window for "about:debugging", then there is only one window is left with the "about:sessionrestore" tab.
- Click the button "Restore Session" in the "about:sessionrestore" tab. Then last tabs are restored.
- Ctrl-Shift-N to reopen the "about:debugging" window.
- Click "Inspect" button of the loaded testcase addon.
- Choose the "Console" tab.
Expected result
Changes of the title
attribute are logged for all tabs including the "about:sessionrestore".
Actual result
Changes of the title
attribute are logged for all tabs except the "about:sessionrestore" tab tab (it maybe has the tabId 2
).
Reporter | ||
Comment 1•5 years ago
|
||
Sorry I forgot to add the version information. I've confirmed this on:
- Windows 10
- Nightly 78.0a1 build ID: 20200521093657
Updated•5 years ago
|
Comment 2•3 years ago
|
||
With https://github.com/piroor/treestyletab/issues/2587 closed (stale): please, is this bug 1640112 still reproducible?
(If I recall correctly, Rob Wu attended to a variety of tab title-oriented bugs a few months ago …)
Reporter | ||
Comment 3•3 years ago
|
||
This problem still appears on Nightly 92.0a1 (build ID: 20210803220119).
The original issue was closed just due to a new project policy: closing stale issues if they have no progress within one year from the last update.
Comment 4•2 years ago
|
||
Still reproduces in Nightly 112.0a1 (2023-03-11).
I took a look yesterday and the problem is that the about:sessionrestore
tab is not initialized properly (_fireTabOpen
is never called for it), this causes a initializingTab
flag to linger forever (even after the tab is reused), which blocks listener notifications to extensions such as Tree Style Tab.
I attach a tentative patch to fix the issue, I am pretty sure the diagnostic is correct, but not so sure about the fix being correct, so I'd appreciate feedback.
Comment 5•2 years ago
|
||
Description
•