Bug 1538583: Themes should not show [ALLOWED IN PRIVATE WINDOWS] notice. r=kmag a=pascalc
authorCosmin Sabou <csabou@mozilla.com>
Tue, 09 Apr 2019 12:08:18 +0300
changeset 523064 44282db3178b0ca701b3d4c27dcc08b15fd37fc2
parent 523063 25c22c51d9ce216261bc35842ef6704b5b678536
child 523065 0dfc99259470484235be9779a886ed8e7d95b22f
push id11046
push usercsabou@mozilla.com
push dateTue, 09 Apr 2019 09:30:48 +0000
treeherdermozilla-beta@19e1fc9a203c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag, pascalc
bugs1538583
milestone67.0
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
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();
   }
 });