Bug 1516548 add private browsing addon notice to about:addons, r=mstriemer,flod
authorShane Caraveo <scaraveo@mozilla.com>
Tue, 29 Jan 2019 01:37:55 +0000
changeset 513645 1155ba90b3e7029562174005936addb843f18ad9
parent 513644 53ea75c61113227fc3c5a157099bde182dd3b57e
child 513646 57a6c0ba17d698a89afd8ab199a6385edf7a1767
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstriemer, flod
bugs1516548
milestone67.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 1516548 add private browsing addon notice to about:addons, r=mstriemer,flod Differential Revision: https://phabricator.services.mozilla.com/D15413
toolkit/locales/en-US/toolkit/about/aboutAddons.ftl
toolkit/mozapps/extensions/content/extensions.js
toolkit/mozapps/extensions/content/extensions.xul
toolkit/themes/shared/extensions/extensions.inc.css
toolkit/themes/shared/in-content/common.inc.css
--- a/toolkit/locales/en-US/toolkit/about/aboutAddons.ftl
+++ b/toolkit/locales/en-US/toolkit/about/aboutAddons.ftl
@@ -199,16 +199,22 @@ plugin-deprecation-description =
 legacy-warning-show-legacy = Show legacy extensions
 
 legacy-extensions =
     .value = Legacy Extensions
 
 legacy-extensions-description =
     These extensions do not meet current { -brand-short-name } standards so they have been deactivated. <label data-l10n-name="legacy-learn-more">Learn about the changes to add-ons</label>
 
+private-browsing-description =
+    Extensions are not allowed to run by default in Private Windows. This means they won’t work
+    while private browsing, and they won’t have access to your online activities there. To allow
+    an extension to run in Private Windows, select the extension card below and change your setting.
+    <label data-l10n-name="private-browsing-learn-more">Learn More.</label>
+
 extensions-view-discover =
     .name = Get Add-ons
     .tooltiptext = { extensions-view-discover.name }
 
 extensions-view-recent-updates =
     .name = Recent Updates
     .tooltiptext = { extensions-view-recent-updates.name }
 
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -2414,16 +2414,23 @@ var gListView = {
       }
     });
 
     document.getElementById("signing-learn-more").setAttribute("href", SUPPORT_URL + "unsigned-addons");
     document.getElementById("legacy-extensions-learnmore-link").addEventListener("click", evt => {
       gViewController.loadView("addons://legacy/");
     });
 
+    try {
+      document.getElementById("private-browsing-learnmore-link")
+              .setAttribute("href", SUPPORT_URL + "extensions-pb");
+    } catch (e) {
+      document.getElementById("private-browsing-notice").hidden = true;
+    }
+
     let findSignedAddonsLink = document.getElementById("find-alternative-addons");
     try {
       findSignedAddonsLink.setAttribute("href",
         Services.urlFormatter.formatURLPref("extensions.getAddons.link.url"));
     } catch (e) {
       findSignedAddonsLink.classList.remove("text-link");
     }
 
@@ -2471,16 +2478,19 @@ var gListView = {
         let preLen = aAddonsList.length;
         aAddonsList = aAddonsList.filter(addon => !isLegacyExtension(addon) &&
                                                   !isDisabledUnsigned(addon));
         if (aAddonsList.length != preLen) {
           showLegacyInfo = true;
         }
       }
 
+      let privateNotice = document.getElementById("private-browsing-notice");
+      privateNotice.hidden = allowPrivateBrowsingByDefault || aType != "extension";
+
       var elements = [];
 
       for (let addonItem of aAddonsList)
         elements.push(createItem(addonItem));
 
       for (let installItem of aInstallsList)
         elements.push(createItem(installItem, true));
 
--- a/toolkit/mozapps/extensions/content/extensions.xul
+++ b/toolkit/mozapps/extensions/content/extensions.xul
@@ -290,33 +290,43 @@
               </button>
             </hbox>
           </hbox>
 
           <deck id="headered-views-content" flex="1" selectedIndex="0">
             <!-- list view -->
             <vbox id="list-view" flex="1" class="view-pane" align="stretch" tabindex="0">
               <!-- info UI for add-ons that have been disabled for being unsigned -->
-              <vbox id="disabled-unsigned-addons-info" hidden="true">
+              <vbox id="disabled-unsigned-addons-info" class="alert-container" hidden="true">
                 <label id="disabled-unsigned-addons-heading" data-l10n-id="disabled-unsigned-heading"/>
                 <description data-l10n-id="disabled-unsigned-description">
                   <label class="text-link plain" id="find-alternative-addons" data-l10n-name="find-addons"/>
                 </description>
                 <hbox pack="start"><label class="text-link" id="signing-learn-more" data-l10n-id="disabled-unsigned-learn-more"></label></hbox>
                 <description id="signing-dev-info" data-l10n-id="disabled-unsigned-devinfo">
                   <label class="text-link plain" id="signing-dev-manual-link" data-l10n-name="learn-more"/>
                 </description>
               </vbox>
               <vbox id="legacy-extensions-notice" class="alert-container" hidden="true">
                 <vbox class="alert">
                   <description id="legacy-extensions-description">
                     <label class="text-link plain" id="legacy-extensions-learnmore-link" data-l10n-id="legacy-warning-show-legacy"/>
                   </description>
                 </vbox>
               </vbox>
+              <vbox id="private-browsing-notice" class="alert-container" hidden="true" align="start">
+                <hbox class="message-bar" align="start">
+                  <image class="message-bar-icon"/>
+                  <vbox class="message-container">
+                    <description class="message-bar-description" data-l10n-id="private-browsing-description">
+                      <label class="text-link plain" id="private-browsing-learnmore-link" data-l10n-name="private-browsing-learn-more"/>
+                    </description>
+                  </vbox>
+                </hbox>
+              </vbox>
               <vbox id="plugindeprecation-notice" class="list-view-notice" align="start">
                 <hbox class="message-bar">
                   <image class="message-bar-icon"/>
                   <description class="message-bar-description" data-l10n-id="plugin-deprecation-description">
                     <label class="text-link plain" id="plugindeprecation-learnmore-link" data-l10n-name="learn-more"></label>
                   </description>
                 </hbox>
               </vbox>
--- a/toolkit/themes/shared/extensions/extensions.inc.css
+++ b/toolkit/themes/shared/extensions/extensions.inc.css
@@ -13,21 +13,23 @@
   min-height: 39px;
 }
 
 .view-pane > .list {
   padding-right: 24px;
   padding-left: 24px;
 }
 
-
 /*** global warnings ***/
 
 .global-warning-container {
   overflow-x: hidden;
+  margin-right: 28px;
+  margin-left: 28px;
+  max-width: 664px;
 }
 
 .global-warning {
   -moz-box-align: center;
   padding: 0 8px;
   color: #c8a91e;
   font-weight: bold;
 }
@@ -92,18 +94,20 @@
 .addon-view[pending="uninstall"] .pending-icon {
   list-style-image: url("chrome://mozapps/skin/extensions/alerticon-info-negative.svg");
 }
 
 /*** view alert boxes ***/
 
 .alert-container {
   -moz-box-align: center;
-  margin-right: 48px;
-  margin-left: 48px;
+  margin-right: 28px;
+  margin-left: 28px;
+  max-width: 664px;
+  margin-bottom: 10px;
 }
 
 .alert-spacer-before {
   -moz-box-flex: 1;
 }
 
 .alert-spacer-after {
   -moz-box-flex: 3;
@@ -407,16 +411,23 @@ button.warning {
   font-size: 0.9rem;
   font-weight: 600;
   -moz-user-focus: ignore;
   transition-property: color, background-color;
   transition-timing-function: var(--animation-curve);
   transition-duration: 150ms;
 }
 
+.message-container {
+  /* private-browsing-notice.max-width(664)
+     - message-bar.padding(8)
+     - message-bar-icon.computed-width(28) */
+  max-width: 628px;
+}
+
 .legacy-warning {
   background-color: #FFE900;
   color: #3E2800;
   padding: 4px 5px 3px;
   font-size: 0.9rem;
   font-weight: 600;
   -moz-user-focus: ignore;
   transition-property: color, background-color;
--- a/toolkit/themes/shared/in-content/common.inc.css
+++ b/toolkit/themes/shared/in-content/common.inc.css
@@ -804,17 +804,17 @@ xul|treechildren::-moz-tree-image(select
   border-radius: 4px;
   color: var(--grey-90);
   min-height: 32px;
   -moz-box-align: center;
   padding: 4px;
 }
 
 .message-bar-description {
-  margin: 0;
+  margin: 2px 0;
   line-height: 1.25;
 }
 
 /* The message-bar-button styles have extra specificity to override
  * the defaults for buttons. */
 .message-bar-content > .message-bar-button {
   background-color: var(--grey-90-a10);
   border: none;