Closed Bug 1320870 Opened 8 years ago Closed 7 years ago

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

Categories

(WebExtensions :: Untriaged, defect)

defect
Not set
normal

Tracking

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

RESOLVED INCOMPLETE
Tracking Status
firefox50 --- affected
firefox51 --- affected
firefox52 --- affected
firefox53 --- affected

People

(Reporter: cpeterson, Unassigned)

References

()

Details

(Whiteboard: [private] investigation)

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
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.
do you want us to keep this open or reopen if you see again?
Flags: needinfo?(cpeterson)
Whiteboard: [private] investigation
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
Closed: 7 years ago
Flags: needinfo?(cpeterson)
Resolution: --- → INCOMPLETE
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.