Bug 1508979 - Fix global-scope pollution from browser-plugins.js. r=Gijs
authorDão Gottwald <dao@mozilla.com>
Fri, 23 Nov 2018 18:07:39 +0000
changeset 447898 deed2b6607e9b77e0b5cc92ac16ed734629b37f0
parent 447897 856f149c4faa4ebbe466f58d0c56dbb2f9ba83d0
child 447899 9823c01c5580ae5d79d1b17f9f5efc3aba6a8d94
push id73624
push userdgottwald@mozilla.com
push dateFri, 23 Nov 2018 20:24:39 +0000
treeherderautoland@deed2b6607e9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1508979
milestone65.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 1508979 - Fix global-scope pollution from browser-plugins.js. r=Gijs Differential Revision: https://phabricator.services.mozilla.com/D12528
browser/base/content/browser-plugins.js
--- a/browser/base/content/browser-plugins.js
+++ b/browser/base/content/browser-plugins.js
@@ -1,16 +1,13 @@
 /* -*- 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/. */
 
-ChromeUtils.defineModuleGetter(this, "Blocklist",
-                               "resource://gre/modules/Blocklist.jsm");
-
 var gPluginHandler = {
   PREF_SESSION_PERSIST_MINUTES: "plugin.sessionPermissionNow.intervalInMinutes",
   PREF_PERSISTENT_DAYS: "plugin.persistentPermissionAlways.intervalInDays",
 
   MESSAGES: [
     "PluginContent:ShowClickToPlayNotification",
     "PluginContent:RemoveNotification",
     "PluginContent:InstallSinglePlugin",
@@ -80,16 +77,17 @@ var gPluginHandler = {
   // Callback for user clicking on a disabled plugin
   managePlugins() {
     BrowserOpenAddonsMgr("addons://list/plugin");
   },
 
   // Callback for user clicking on the link in a click-to-play plugin
   // (where the plugin has an update)
   async openPluginUpdatePage(pluginTag) {
+    let { Blocklist } = ChromeUtils.import("resource://gre/modules/Blocklist.jsm", {});
     let url = await Blocklist.getPluginBlockURL(pluginTag);
     openTrustedLinkIn(url, "tab");
   },
 
   submitReport: function submitReport(runID, keyVals, submitURLOptIn) {
     if (!AppConstants.MOZ_CRASHREPORTER) {
       return;
     }