browserAction.onClicked callback returns wrong active tab when in private browsing window

RESOLVED INCOMPLETE

Status

RESOLVED INCOMPLETE
2 years ago
3 months ago

People

(Reporter: cpeterson, Unassigned)

Tracking

unspecified

Firefox Tracking Flags

(firefox50 affected, firefox51 affected, firefox52 affected, firefox53 affected)

Details

(Whiteboard: [private] investigation, URL)

(Reporter)

Description

2 years ago
STR:
1. Install my "Open Page in Private Window" extension: https://addons.mozilla.org/en-US/firefox/addon/open-page-in-private-window/
2. Open https://addons.mozilla.org/ in a new tab 
3. Click the ghost toolbar button.
4. https://addons.mozilla.org/ should open in a new private window.
5. Open a new non-private window.
6. Open https://wiki.mozilla.org/Main_Page in a new tab in the new non-private window.
7. Press the ghost toolbar button.

RESULT:
https://addons.mozilla.org/ should open in a new private window but I expected https://wiki.mozilla.org/Main_Page to open. I tested the same extension code in Chrome and it opens the expected active tab.

The browserAction.onClicked callback appears to return the previously-active tab from the first window instead of the currently active tab in the new window. I confirmed that this is happening by logging the onClicked callback's tab parameter's window and tab ids.

Here is my extension's callback code:

https://github.com/cpeterso/open-page-in-private-window/blob/master/src/background.js#L14

If you right-click in the https://wiki.mozilla.org/Main_Page tab in the new non-private window and select "Open Page in Private Window", then the correct active tab is opened. After opening the new tab using the context menu item, the browserAction.onClicked callback then returns the correct active tab when clicking the toolbar button.
This seems to work as expected for me. And the code for the onClicked event definitely returns the active tab from the most recent browser window (though arguably it should return the active tab from the window where it was clicked, instead).

Can you provide more details about your browser configuration?
Summary: browserAction.onClicked callback returns wrong active tab when using multiple windows → browserAction.onClicked callback returns wrong active tab when in private browsing window
(Reporter)

Comment 2

2 years ago
I can't reproduce this problem in a clean profile and the problem went away after I "refreshed" my test profile. I can still reproduce in one of my old profiles, so I will try to isolate the problem there.

Comment 3

2 years ago
do you want us to keep this open or reopen if you see again?
Flags: needinfo?(cpeterson)
Whiteboard: [private] investigation
(Reporter)

Comment 4

2 years ago
I'll close this bug for now. I can still reproduce in one profile, but not a clean profile. I don't know when I'll have time to investigate further.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Flags: needinfo?(cpeterson)
Resolution: --- → INCOMPLETE

Updated

3 months ago
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.