Open
Bug 1382652
Opened 7 years ago
Updated 1 year ago
browser.extension.getViews does not return extension popups from private windows
Categories
(WebExtensions :: General, defect, P3)
Tracking
(Not tracked)
NEW
People
(Reporter: mauriciosimoeso, Unassigned)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [extension])
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36 OPR/46.0.2597.46
Steps to reproduce:
When calling browser.extension.getViews({type: "popup"}) from a background page the popups on private pages are not listed.
The documentation about the function (https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/extension/getViews) says nothing about any restrictions on the page context (Private or non private).
I've seen another bug (https://bugzilla.mozilla.org/show_bug.cgi?id=1309620) that may be related to this one, but I'm not sure. In this bug is said that private windows cannot access content on non-private windows, but the background page is something different.
This function on chrome does return all popups, even the ones in a private window.
Actual results:
The function returned an empty list.
Expected results:
The function should return a list with all popup windows open in that moment.
Updated•7 years ago
|
Component: Untriaged → WebExtensions: General
Product: Firefox → Toolkit
Updated•7 years ago
|
Priority: -- → P3
Whiteboard: [extension]
Comment 1•7 years ago
|
||
(In reply to Maurício Simões de Oliveira from comment #0)
> This function on chrome does return all popups, even the ones in a private
> window.
In Chrome, all extension pages run in normal browsing mode by default.
Incognito access is disabled by default too; If the user opts in to enabling the extension in incognito mode, then the popup will still be shown in normal browsing mode.
An extension can set "incognito":"split" in manifest.json to render the popup of incognito windows in an incognito profile.
Firefox does not support split incognito mode, and renders the popup in normal or private browsing mode, depending on the window.
In the past, Firefox also included the private popup window in getViews(), but it was not accessible to the background page (throwing a security error upon trying): bug 1309620 (the bug you linked).
We could do any of the following here:
- Not change anything and mark this bug as WONTFIX + document this difference in private browsing handling on MDN
- If incognito:"spanning" is used, always render popups in the non-private-browsing profile.
(this should be done if we want compatibility with Chrome).
Test case for QA:
1. Install any extension with an extension popup, e.g. uBlock Origin.
2. Open the debugger for the extension, via the steps at https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Debugging#The_Add-on_Debugger
3. Ensure that the popup stays open, via the steps at https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Debugging#Debugging_popups
4. Open a Private browsing window (Ctrl-Shift-P)
5. Click on the extension popup.
6. Open the console of the debugger from step 2, and type: browser.extension.getViews({type:'popup'})
Expected: an array with one window: [window]
Actual : [] (empty array)
Blocks: 1460738, webextensions-chrome-gaps
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: browser.extension.getViews → browser.extension.getViews does not return extension popups from private windows
Updated•6 years ago
|
Product: Toolkit → WebExtensions
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•