Open Bug 1640112 Opened 5 years ago Updated 2 years ago

Updated "title" is not notified via "tabs.onUpdated" listeners for a tab recycled by "about:sessionrestore"

Categories

(WebExtensions :: General, defect, P5)

defect

Tracking

(Not tracked)

People

(Reporter: yuki, Unassigned)

Details

Attachments

(2 files)

"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

  1. Start Firefox with a clean profile.
  2. Open two or more tabs with arbitrary webpages.
  3. 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"
  4. Start Firefox again.
  5. All tabs are restored automatically, then click other tabs to load them.
  6. Kill the process of Firefox again with the method same to the step 3.
  7. Start Firefox again.
  8. Then you'll see "about:sessionrestore" tab. Don't touch it here.
  9. Open a new Firefox window with Ctrl-N.
  10. Load "about:debugging".
  11. Choose "This Nightly".
  12. Click "Load Temporary Add-on...".
  13. 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"] }
);
  1. Close the window for "about:debugging", then there is only one window is left with the "about:sessionrestore" tab.
  2. Click the button "Restore Session" in the "about:sessionrestore" tab. Then last tabs are restored.
  3. Ctrl-Shift-N to reopen the "about:debugging" window.
  4. Click "Inspect" button of the loaded testcase addon.
  5. 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).

Sorry I forgot to add the version information. I've confirmed this on:

  • Windows 10
  • Nightly 78.0a1 build ID: 20200521093657
Severity: -- → S4
Priority: -- → P5

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 …)

Flags: needinfo?(yuki)

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.

Flags: needinfo?(yuki)

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.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: