Bug 1497087 Remove eula support from addons manager r=Gijs,aswan
authorCollin Wing <masterkrombi@gmail.com>
Fri, 19 Oct 2018 21:52:20 +0000
changeset 491062 3377d76041ed9940b811024745441d7b8846b29a
parent 491061 8468729762b5111214f3d75f7b10f841227ad842
child 491063 73b5fa4feb449d10c332c24c8bbac7af8329c7d2
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersGijs, aswan
bugs1497087
milestone65.0a1
Bug 1497087 Remove eula support from addons manager r=Gijs,aswan Differential Revision: https://phabricator.services.mozilla.com/D8149
caps/tests/mochitest/test_bug292789.html
toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd
toolkit/locales/en-US/chrome/mozapps/extensions/extensions.properties
toolkit/mozapps/extensions/content/eula.js
toolkit/mozapps/extensions/content/eula.xul
toolkit/mozapps/extensions/content/extensions.xml
toolkit/mozapps/extensions/jar.mn
toolkit/themes/osx/mozapps/extensions/eula.css
toolkit/themes/osx/mozapps/jar.mn
toolkit/themes/shared/non-mac.jar.inc.mn
toolkit/themes/windows/mozapps/extensions/eula.css
--- a/caps/tests/mochitest/test_bug292789.html
+++ b/caps/tests/mochitest/test_bug292789.html
@@ -8,17 +8,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=292789">Mozilla Bug 292789</a>
 <p id="display"></p>
 <div id="content" style="display: none">
   <script src="chrome://global/content/treeUtils.js"></script>
-  <script type="application/javascript" src="chrome://mozapps/content/extensions/eula.js"></script>
+  <script type="application/javascript" src="chrome://mozapps/content/extensions/blocklist.js"></script>
   <script id="resjs" type="application/javascript"></script>
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 /** Test for Bug 292789
  **
  ** Selectively allow access to whitelisted chrome packages
@@ -40,22 +40,22 @@ function testScriptSrc(aCallback) {
     is(typeof Startup, "undefined",
        "content should not be able to load <script> from chrome://mozapps");
 
     /** make sure the last one didn't pass because someone
      ** moved the resource
      **/
     var resjs = document.getElementById("resjs");
     resjs.onload = scriptOnload;
-    resjs.src = "resource://gre/chrome/toolkit/content/mozapps/extensions/eula.js";
+    resjs.src = "resource://gre/chrome/toolkit/content/mozapps/extensions/blocklist.js";
     document.getElementById("content").appendChild(resjs);
 
     function scriptOnload() {
-      is(typeof Startup, "function",
-         "extensions.js has not moved unexpectedly");
+      is(typeof init, "function",
+         "blocklist.js has not moved unexpectedly");
 
       // trigger the callback
       if (aCallback)
         aCallback();
     }
 }
 
 /** <img src=""> tests **/
--- a/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd
+++ b/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd
@@ -123,16 +123,11 @@
 <!ENTITY addon.updateAvailable.label          "An update is available">
 <!ENTITY addon.checkingForUpdates.label       "Checking for updates…">
 <!ENTITY addon.releaseNotes.label             "Release Notes:">
 <!ENTITY addon.loadingReleaseNotes.label      "Loading…">
 <!ENTITY addon.errorLoadingReleaseNotes.label "Sorry, but there was an error loading the release notes.">
 
 <!ENTITY addon.createdBy.label                "By ">
 
-<!ENTITY eula.title                           "End-User License Agreement">
-<!ENTITY eula.width                           "560px">
-<!ENTITY eula.height                          "400px">
-<!ENTITY eula.accept                          "Accept and Install…">
-
 <!ENTITY settings.path.button.label           "Browse…">
 
 <!ENTITY setting.learnmore "Learn More…">
--- a/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.properties
+++ b/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.properties
@@ -86,19 +86,16 @@ details.notification.gmpPending=%1$S wil
 
 installFromFile.dialogTitle=Select add-on to install
 installFromFile.filterName=Add-ons
 
 uninstallAddonTooltip=Uninstall this add-on
 enableAddonTooltip=Enable this add-on
 disableAddonTooltip=Disable this add-on
 
-#LOCALIZATION NOTE (eulaHeader) %S is name of the add-on asking the user to agree to the EULA
-eulaHeader=%S requires that you accept the following End User License Agreement before installation can proceed:
-
 type.extension.name=Extensions
 type.themes.name=Themes
 type.locale.name=Languages
 type.plugin.name=Plugins
 type.dictionary.name=Dictionaries
 type.service.name=Services
 type.legacy.name=Legacy Extensions
 type.unsupported.name=Unsupported
deleted file mode 100644
--- a/toolkit/mozapps/extensions/content/eula.js
+++ /dev/null
@@ -1,26 +0,0 @@
-// -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-/* exported Startup */
-
-ChromeUtils.import("resource://gre/modules/AddonManager.jsm");
-
-function Startup() {
-  var bundle = document.getElementById("extensionsStrings");
-  var addon = window.arguments[0].addon;
-
-  document.documentElement.setAttribute("addontype", addon.type);
-
-  var iconURL = AddonManager.getPreferredIconURL(addon, 48, window);
-  if (iconURL)
-    document.getElementById("icon").src = iconURL;
-
-  var label = document.createTextNode(bundle.getFormattedString("eulaHeader", [addon.name]));
-  document.getElementById("heading").appendChild(label);
-  document.getElementById("eula").value = addon.eula;
-}
deleted file mode 100644
--- a/toolkit/mozapps/extensions/content/eula.xul
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://mozapps/skin/extensions/eula.css" type="text/css"?>
-
-<!DOCTYPE window [
-<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
-%brandDTD;
-<!ENTITY % extensionsDTD SYSTEM "chrome://mozapps/locale/extensions/extensions.dtd">
-%extensionsDTD;
-]>
-
-<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        title="&eula.title;" width="&eula.width;" height="&eula.height;"
-        buttons="accept,cancel" buttonlabelaccept="&eula.accept;"
-        ondialogaccept="window.arguments[0].accepted = true"
-        onload="Startup();">
-
-  <script type="application/javascript" src="chrome://mozapps/content/extensions/eula.js"/>
-  
-  <stringbundleset id="extensionsSet">
-    <stringbundle id="extensionsStrings" src="chrome://mozapps/locale/extensions/extensions.properties"/>
-  </stringbundleset>
-
-  <hbox id="heading-container">
-    <image id="icon"/>
-    <label id="heading" flex="1"/>
-  </hbox>
-  
-  <textbox id="eula" multiline="true" readonly="true" flex="1"/>
-</dialog>
--- a/toolkit/mozapps/extensions/content/extensions.xml
+++ b/toolkit/mozapps/extensions/content/extensions.xml
@@ -431,27 +431,16 @@
         ]]></body>
       </method>
 
       <method name="installRemote">
         <body><![CDATA[
           if (this.mControl.getAttribute("remote") != "true")
             return;
 
-          if (this.mControl.mAddon.eula) {
-            var data = {
-              addon: this.mControl.mAddon,
-              accepted: false,
-            };
-            window.openDialog("chrome://mozapps/content/extensions/eula.xul", "_blank",
-                              "chrome,dialog,modal,centerscreen,resizable=no", data);
-            if (!data.accepted)
-              return;
-          }
-
           delete this.mControl.mAddon;
           this.mControl.mInstall = this.mInstall;
           this.mControl.setAttribute("status", "installing");
           let prompt = Services.prefs.getBoolPref("extensions.webextPermissionPrompts", false);
           if (prompt) {
             this.mInstall.promptHandler = info => new Promise((resolve, reject) => {
               // Skip prompts for non-webextensions
               if (!info.addon.userPermissions) {
--- a/toolkit/mozapps/extensions/jar.mn
+++ b/toolkit/mozapps/extensions/jar.mn
@@ -10,14 +10,12 @@ toolkit.jar:
   content/mozapps/extensions/extensions.css                     (content/extensions.css)
   content/mozapps/extensions/extensions.js                      (content/extensions.js)
 * content/mozapps/extensions/extensions.xml                     (content/extensions.xml)
   content/mozapps/extensions/updateinfo.xsl                     (content/updateinfo.xsl)
   content/mozapps/extensions/blocklist.xul                      (content/blocklist.xul)
   content/mozapps/extensions/blocklist.js                       (content/blocklist.js)
   content/mozapps/extensions/blocklist.css                      (content/blocklist.css)
   content/mozapps/extensions/blocklist.xml                      (content/blocklist.xml)
-  content/mozapps/extensions/eula.xul                           (content/eula.xul)
-  content/mozapps/extensions/eula.js                            (content/eula.js)
   content/mozapps/extensions/pluginPrefs.xul                    (content/pluginPrefs.xul)
   content/mozapps/extensions/pluginPrefs.js                     (content/pluginPrefs.js)
   content/mozapps/extensions/OpenH264-license.txt               (content/OpenH264-license.txt)
 #endif
deleted file mode 100644
--- a/toolkit/themes/osx/mozapps/extensions/eula.css
+++ /dev/null
@@ -1,43 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#icon {
-  list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric.svg");
-  max-width: 48px;
-  max-height: 48px;
-  margin-inline-end: 6px;
-}
-
-#eula-dialog[addontype="theme"] #icon {
-  list-style-image: url("chrome://mozapps/skin/extensions/themeGeneric.svg");
-}
-
-#eula-dialog[addontype="locale"] #icon {
-  list-style-image: url("chrome://mozapps/skin/extensions/localeGeneric.svg");
-}
-
-#eula-dialog[addontype="plugin"] #icon {
-  list-style-image: url("chrome://mozapps/skin/plugins/pluginGeneric.svg");
-}
-
-#eula-dialog[addontype="dictionary"] #icon {
-  list-style-image: url("chrome://mozapps/skin/extensions/dictionaryGeneric.svg");
-}
-
-#heading-container {
-  -moz-box-align: center;
-}
-
-#heading {
-  font-size: 120%;
-}
-
-#eula {
-  -moz-appearance: none;
-  color: -moz-FieldText;
-  background-color: -moz-Field;
-  margin: 1em;
-  border: 1px solid ActiveBorder;
-}
-
--- a/toolkit/themes/osx/mozapps/jar.mn
+++ b/toolkit/themes/osx/mozapps/jar.mn
@@ -8,15 +8,14 @@ toolkit.jar:
   skin/classic/mozapps/downloads/unknownContentType.css           (downloads/unknownContentType.css)
   skin/classic/mozapps/extensions/discover-logo.png               (extensions/discover-logo.png)
   skin/classic/mozapps/extensions/rating-won.png                  (extensions/rating-won.png)
   skin/classic/mozapps/extensions/rating-not-won.png              (extensions/rating-not-won.png)
   skin/classic/mozapps/extensions/cancel.png                      (extensions/cancel.png)
   skin/classic/mozapps/extensions/toolbarbutton-dropmarker.png    (extensions/toolbarbutton-dropmarker.png)
   skin/classic/mozapps/extensions/heart.png                       (extensions/heart.png)
 * skin/classic/mozapps/extensions/extensions.css                  (extensions/extensions.css)
-  skin/classic/mozapps/extensions/eula.css                        (extensions/eula.css)
   skin/classic/mozapps/extensions/blocklist.css                   (extensions/blocklist.css)
   skin/classic/mozapps/plugins/pluginHelp-16.png                  (plugins/pluginHelp-16.png)
   skin/classic/mozapps/profile/profileSelection.css               (profile/profileSelection.css)
   skin/classic/mozapps/update/buttons.png                         (update/buttons.png)
 * skin/classic/mozapps/update/updates.css                         (update/updates.css)
   skin/classic/mozapps/handling/handling.css                      (handling/handling.css)
--- a/toolkit/themes/shared/non-mac.jar.inc.mn
+++ b/toolkit/themes/shared/non-mac.jar.inc.mn
@@ -34,15 +34,14 @@
 
   skin/classic/mozapps/downloads/downloadButtons.png         (../../windows/mozapps/downloads/downloadButtons.png)
   skin/classic/mozapps/downloads/unknownContentType.css      (../../windows/mozapps/downloads/unknownContentType.css)
   skin/classic/mozapps/extensions/blocklist.css              (../../windows/mozapps/extensions/blocklist.css)
   skin/classic/mozapps/extensions/discover-logo.png          (../../windows/mozapps/extensions/discover-logo.png)
   skin/classic/mozapps/extensions/rating-won.png             (../../windows/mozapps/extensions/rating-won.png)
   skin/classic/mozapps/extensions/rating-not-won.png         (../../windows/mozapps/extensions/rating-not-won.png)
   skin/classic/mozapps/extensions/cancel.png                 (../../windows/mozapps/extensions/cancel.png)
-  skin/classic/mozapps/extensions/eula.css                   (../../windows/mozapps/extensions/eula.css)
   skin/classic/mozapps/handling/handling.css                 (../../windows/mozapps/handling/handling.css)
   skin/classic/mozapps/plugins/pluginHelp-16.png             (../../windows/mozapps/plugins/pluginHelp-16.png)
   skin/classic/mozapps/profile/profileSelection.css          (../../windows/mozapps/profile/profileSelection.css)
   skin/classic/mozapps/update/downloadButtons.png            (../../windows/mozapps/update/downloadButtons.png)
 
 % override chrome://mozapps/skin/xpinstall/xpinstallItemGeneric.png       chrome://mozapps/skin/extensions/extensionGeneric.svg
deleted file mode 100644
--- a/toolkit/themes/windows/mozapps/extensions/eula.css
+++ /dev/null
@@ -1,43 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#icon {
-  list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric.svg");
-  max-width: 48px;
-  max-height: 48px;
-  margin-inline-end: 6px;
-}
-
-#eula-dialog[addontype="theme"] #icon {
-  list-style-image: url("chrome://mozapps/skin/extensions/themeGeneric.svg");
-}
-
-#eula-dialog[addontype="locale"] #icon {
-  list-style-image: url("chrome://mozapps/skin/extensions/localeGeneric.svg");
-}
-
-#eula-dialog[addontype="plugin"] #icon {
-  list-style-image: url("chrome://mozapps/skin/plugins/pluginGeneric.svg");
-}
-
-#eula-dialog[addontype="dictionary"] #icon {
-  list-style-image: url("chrome://mozapps/skin/extensions/dictionaryGeneric.svg");
-}
-
-#heading-container {
-  -moz-box-align: center;
-}
-
-#heading {
-  font-size: 120%;
-}
-
-#eula {
-  -moz-appearance: none;
-  color: -moz-FieldText;
-  background-color: -moz-Field;
-  margin: 1em;
-  border: 1px solid ActiveBorder;
-}
-