Bug 1538583: Themes should not show [ALLOWED IN PRIVATE WINDOWS] notice r=kmag

Themes should not show [ALLOWED IN PRIVATE WINDOWS] notice

Differential Revision: https://phabricator.services.mozilla.com/D25411

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Trishul 2019-03-29 20:44:42 +00:00
parent c28222aaf1
commit ab8d5216f0
2 changed files with 7 additions and 1 deletions

View File

@ -903,7 +903,7 @@
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);

View File

@ -135,6 +135,12 @@ add_task(async function testThemeOrdering() {
],
"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();