Closed Bug 2053343 Opened 4 months ago Closed 1 month ago

Tab discarded via browser.tabs.discard API visually still display as loaded.

Categories

(Firefox :: Session Restore, defect, P3)

Firefox 152
x86_64
Windows 10
defect

Tracking

()

RESOLVED DUPLICATE of bug 2000401

People

(Reporter: mk.eesti+bugzilla, Unassigned)

References

Details

(Keywords: blocked-ux)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:151.0) Gecko/20100101 Firefox/151.0

Steps to reproduce:

Tab discarded by addons via browser.tabs.discard API visually still display as loaded in the default Firefox UI.

Similarly, when browser is just started and previous session is restored, all tabs are displayed as loaded, even though they are all discarded.

This issue only happens in native Firefox UI, the addons that display their own tabs have no problem reacting to tabs being programmatically discarded (or already discarded on browser startup) and visually changing their display.

Versions tested:
Windows 151.0.2 (64-bit)
Windows 152.0.4 (64-bit)
Windows 152.0.5 (64-bit)

Actual results:

Tabs discarded via browser.tabs.discard API or loaded from a pervious session as already discarded visually still display as loaded in the default Firefox UI.

Expected results:

Tabs discarded via browser.tabs.discard API or loaded from a pervious session as already discarded visually should display as discarded, to differentiate them from loaded tabs.

OS: Unspecified → Windows 10
Hardware: Unspecified → x86_64
Version: Firefox 151 → Firefox 152

The Bugbug bot thinks this bug should belong to the 'Firefox::Session Restore' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

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

Can you please let me know what extension was used for reproducing this issue?

Flags: needinfo?(mk.eesti+bugzilla)

You can reproduce it with literally any extension, even an empty one,
by just issuing a direct discard command to tabs via console.

  1. Load any extension via about:debugging as a temporary extension
  2. Use 'Inspect' for it to open the console
  3. Use this command:
    browser.tabs.query({ active: false }).then(tabs => { const ids = tabs.map(t => t.id); browser.tabs.discard(ids).then(() => { console.log(Discarded ${ids.length} tabs.); }); });
    To discard all tabs besides the active one.
  4. Observe that there is no changes in tab appearance, despite them being discarded.

To confirm that the tab is actually discarded (since FF doesn't show it in any way) without activating it,
hover over it - if preview is empty, its discarded.

Flags: needinfo?(mk.eesti+bugzilla)
browser.tabs.query({ active: false }).then(tabs => {
  const ids = tabs.map(t => t.id);
  browser.tabs.discard(ids).then(() => {
    console.log(`Discarded ${ids.length} tabs.`);
  });
});

Formatting above mangled the code, here is the correct version.

Thank you . I am now able to confirm the issue and I will mark it as new.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Duplicate of this bug: 2053340
Component: General → Tabbed Browser
Product: WebExtensions → Firefox
Severity: -- → S4
Component: Tabbed Browser → Session Restore
Keywords: blocked-ux
Priority: -- → P3
Status: NEW → RESOLVED
Closed: 1 month ago
Duplicate of bug: 2000401
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.