Bug 1538583: Themes should not show [ALLOWED IN PRIVATE WINDOWS] notice. r=kmag a=pascalc
Summary: Themes should not show [ALLOWED IN PRIVATE WINDOWS] notice
Reviewers: kmag
Reviewed By: kmag
Subscribers: mstriemer, mixedpuppy
Bug #: 1538583
Differential Revision:
https://phabricator.services.mozilla.com/D25411
--- a/toolkit/mozapps/extensions/content/extensions.xml
+++ b/toolkit/mozapps/extensions/content/extensions.xml
@@ -898,17 +898,17 @@
this.setAttribute("previewURL", previewURL ? previewURL : "");
this.setAttribute("hasPreview", previewURL ? "true" : "fase");
let legacyWarning = legacyExtensionsEnabled && !this.mAddon.install &&
isLegacyExtension(this.mAddon);
this.setAttribute("legacy", legacyWarning);
document.getAnonymousElementByAttribute(this, "anonid", "legacy").href = SUPPORT_URL + "webextensions";
- if (!allowPrivateBrowsingByDefault) {
+ if (!allowPrivateBrowsingByDefault && this.mAddon.type === "extension") {
ExtensionPermissions.get(this.mAddon.id).then((perms) => {
let allowed = perms.permissions.includes("internal:privateBrowsingAllowed");
this.setAttribute("privateBrowsing", allowed);
if (!allowed && PrivateBrowsingUtils.isContentWindowPrivate(window)) {
// Hide the preferences button if the current window is
// private and the addon is not allowed to access it.
this._preferencesBtn.hidden = true;
}
--- a/toolkit/mozapps/extensions/test/browser/browser_theme_previews.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_theme_previews.js
@@ -130,13 +130,19 @@ add_task(async function testThemeOrderin
idOrder,
[
themeId(8), // The active theme first.
themeId(6), themeId(7), // With previews, ordered by name.
themeId(5), // The theme without a preview last.
],
"Themes are ordered by enabled, previews, then name");
+ // Ensure allow in private mode badge is hidden for themes.
+ for (let item of list.itemChildren) {
+ let badge = gManagerWindow.document.getAnonymousElementByAttribute(item, "anonid", "privateBrowsing");
+ is_element_hidden(badge, `private browsing badge is hidden`);
+ }
+
await close_manager(gManagerWindow);
for (let addon of await promiseAddonsByIDs(themeIds)) {
await addon.uninstall();
}
});