Add unit tests for visibility of inline options with "internal:privateBrowsingAllowed" permission and incognito:not_allowed
Categories
(Toolkit :: Add-ons Manager, task, P3)
Tracking
()
People
(Reporter: robwu, Assigned: robwu)
References
Details
When an add-on has the "internal:privateBrowsingAllowed"
permission, and is then updated to have incognito: "not_allowed"
in its manifest.json, then the permission is still there, and not correctly enforced, at least at the XUL about:addons
. I fixed this in HTML about:addons
as a part of a different bug, but there are no unit tests for this specific scenario.
STR:
- Create an the following
manifest.json
file:
{
"name": "xxx",
"incognito": "spanning",
"options_ui": {"page": "manifest.json"},
"version": "1",
"manifest_version": 2
}
- Visit
about:debugging
and load the extension (i.e. select the abovemanifest.json
). - Visit
about:addons
and set "Run In Private Windows" to "Allow". - Open a private browsing window, and open
about:addons
, and view the details of the add-on that you loaded. - Edit manifest.json, and change
"incognito": "spanning"
to"incognito": "not_allowed"
. - Reload the add-on.
- Look at
about:addons
of the private browsing window. - Reload once to rule out other bugs (such as bug 1557175).
- Repeat step 7.
Expected:
- At step 5, the inline "Preferences" should be shown.
- At step 7, the inline "Preferences" should be hidden.
- At step 9, the inline "Preferences" should be hidden.
Actual:
- Step 5 is as expected.
- At step 7, the inline "Preferences" is visible.
- At step 9, the inline "Preferences" is still visible.
I've fixed the issue of step 8 in HTML about:addons
(in https://phabricator.services.mozilla.com/D34277), but a test is missing.
We should:
- Add unit tests for this behavior (i.e. load add-on, allow privateBrowsing, then load with incognito:not_allowed)
- Check if there are other places in our code where there the
"internal:privateBrowsingAllowed"
permission is not correctly enforced.
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
FYI:
Fixed by: https://searchfox.org/mozilla-central/rev/22b330ecb3edba1536a54887060cbdd09db21c59/toolkit/mozapps/extensions/content/aboutaddons.js#303-304
Was broken due to missing check for not_allowed
: https://searchfox.org/mozilla-central/rev/2a4fc64e5edc85a29b75610acd527163030808e8/toolkit/mozapps/extensions/content/extensions.js#1544-1553
Updated•2 years ago
|
Description
•