Open Bug 1498432 Opened Last year Updated 2 months ago

A tab discarded immediately after creation, loaded, and then discarded again has an incorrect URL when queried.

Categories

(Firefox :: Session Restore, defect, P3)

63 Branch
defect

Tracking

()

People

(Reporter: anonymous30901032, Unassigned)

References

(Blocks 2 open bugs)

Details

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

Steps to reproduce:

1) In about:debugging, open a console by clicking 'Debug' on an extension like uBlock Origin that can 'Access browser tabs'.

2) Input the following code: 

    browser.tabs.create({
        url: "https://www.google.com",
        active: false
    }).then(tab => {
        browser.tabs.discard(tab.id);
        console.log("tab id = " + tab.id);
        console.log("tab index = " + tab.index);
    });

3) Select the new tab, let it finish loading, and then deselect it. 
    
4) Replace tabIndex with the index of the new tab and run the next line:

    browser.tabs.query({
        index: tabIndex,
        currentWindow: true
    }).then(tabs => console.log("tab url = " + tabs[0].url));
    
5) Replace tabId with the id of the new tab and run the next line:    

    browser.tabs.discard(tabId);

6) Repeat step 4 (the url should be "about:blank").

***

This bug seems to be related to https://bugzilla.mozilla.org/show_bug.cgi?id=1422588
Summary: A tab discarded immediately after creation, loaded, and then discarded again has an incorrect title when queried. → A tab discarded immediately after creation, loaded, and then discarded again has an incorrect URL when queried.
Component: Untriaged → Tabbed Browser

(In reply to anon from comment #0)

  1. Repeat step 4 (the url should be "about:blank").

I'm not sure why you expect this. about:blank isn't loaded there, in fact nothing at all is loaded, so I think we want to return the URL that's going to be loaded when selecting the tab.

Status: UNCONFIRMED → RESOLVED
Closed: 10 months ago
Resolution: --- → INVALID

Sorry, I didn't explain it correctly. On step 6, the url that is returned is "about:blank". I expected it to be "https://www.google.com".

Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INVALID → ---
Component: Tabbed Browser → Session Restore
See Also: → 1522184
Status: REOPENED → NEW
Priority: -- → P3
See Also: → 1528895
See Also: → 1511756
You need to log in before you can comment on or make changes to this bug.