Bug 1577285 - Refactor out a data: URI in loadFrameScript r=kmag
authorTom Ritter <tom@mozilla.com>
Sat, 14 Sep 2019 03:36:33 +0000
changeset 554485 1a2ba5eead516cdf23d0cff5b068e52e80084c6a
parent 554484 d0c1b6d9c9dbe20217ac807e141e6dd187009d74
child 554486 392a39fc60f19ebc2e17484f8726c7ed4b1a7ad2
push id12169
push userffxbld-merge
push dateMon, 14 Oct 2019 16:59:29 +0000
treeherdermozilla-beta@c819687300ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1577285
milestone71.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 1577285 - Refactor out a data: URI in loadFrameScript r=kmag Differential Revision: https://phabricator.services.mozilla.com/D45731
toolkit/components/extensions/ExtensionParent.jsm
toolkit/components/extensions/moz.build
toolkit/components/extensions/onExtensionBrowser.js
--- a/toolkit/components/extensions/ExtensionParent.jsm
+++ b/toolkit/components/extensions/ExtensionParent.jsm
@@ -701,21 +701,17 @@ GlobalManager = {
       case "Extension:SendPerformanceCounter":
         PerformanceCounters.merge(data.counters);
         break;
     }
   },
 
   _onExtensionBrowser(type, browser, additionalData = {}) {
     browser.messageManager.loadFrameScript(
-      `data:,
-      Components.utils.import("resource://gre/modules/Services.jsm");
-
-      Services.obs.notifyObservers(this, "tab-content-frameloader-created", "");
-    `,
+      "resource://gre/modules/onExtensionBrowser.js",
       false,
       true
     );
 
     let viewType = browser.getAttribute("webextension-view-type");
     if (viewType) {
       let data = { viewType };
 
--- a/toolkit/components/extensions/moz.build
+++ b/toolkit/components/extensions/moz.build
@@ -28,16 +28,17 @@ EXTRA_JS_MODULES += [
     'ExtensionTelemetry.jsm',
     'ExtensionUtils.jsm',
     'FindContent.jsm',
     'MatchURLFilters.jsm',
     'MessageChannel.jsm',
     'MessageManagerProxy.jsm',
     'NativeManifests.jsm',
     'NativeMessaging.jsm',
+    'onExtensionBrowser.js',
     'PerformanceCounters.jsm',
     'ProxyScriptContext.jsm',
     'Schemas.jsm',
     'WebNavigation.jsm',
     'WebNavigationContent.js',
     'WebNavigationFrames.jsm',
 ]
 
new file mode 100644
--- /dev/null
+++ b/toolkit/components/extensions/onExtensionBrowser.js
@@ -0,0 +1,8 @@
+/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set sts=2 sw=2 et tw=80: */
+/* 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";
+
+Services.obs.notifyObservers(this, "tab-content-frameloader-created");