Bug 1538583: Themes should not show [ALLOWED IN PRIVATE WINDOWS] notice r=kmag
authorTrishul <trishul.goel@gmail.com>
Fri, 29 Mar 2019 20:44:42 +0000
changeset 466829 92cfc564dbffe32ed1a6501bdddd8e8ea9bdf604
parent 466828 c6b7f090b90ac0616e46e82e14af60a9cf3b186d
child 466830 6adc2a2a4988785c5d69a51f7746cef0bb46b57b
push id81853
push userscaraveo@mozilla.com
push dateFri, 29 Mar 2019 20:45:25 +0000
treeherderautoland@92cfc564dbff [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1538583
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
toolkit/mozapps/extensions/content/extensions.xml
toolkit/mozapps/extensions/test/browser/browser_theme_previews.js
--- 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();
   }
 });