Closed Bug 1418410 Opened 7 years ago Closed 6 years ago

tabs.query() ignores the "discarded" queryInfo property

Categories

(WebExtensions :: Frontend, defect, P3)

57 Branch
defect

Tracking

(firefox59 fixed)

RESOLVED FIXED
Tracking Status
firefox59 --- fixed

People

(Reporter: benedikt.morbach, Unassigned)

References

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0
Build ID: 20171117100127

Steps to reproduce:

I call `browser.tabs.query({discarded: false});` to get all non-discarded tabs.

Minimal example webextension (needs "tabs" permission):

    function forallDiscardable(func) {
        var discardable = browser.tabs.query({discarded: false});
        discardable.then((tabs) => {
            for (let tab of tabs) {
                console.log("forall", tab.discarded, tab.url);
                func(tab);
            }
        });
    }

    forallDiscardable((tab) => {});

Tested on Firefox nightly 59.0a1 (2017-11-17).


Actual results:

All tabs are logged to console.log, most of which with the discarded state "true", as I ran this in a recently restored session.


Expected results:

Only the couple of tabs that have been active since the session was restored should be returned by the query.
Priority: -- → P3
Status: UNCONFIRMED → NEW
Has STR: --- → yes
Ever confirmed: true
OS: Unspecified → All
Hardware: Unspecified → All
Version: Trunk → 57 Branch
Yeah, the discarded getter was implemented but matches() didn't use it. This was fixed in bug 1423725.
Status: NEW → RESOLVED
Closed: 6 years ago
Depends on: 1423725
Resolution: --- → FIXED
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.