Bug 1525200 - Fix history webextension API failing to load when loaded after the bookmarks API. r=zombie
authorLuca Greco <lgreco@mozilla.com>
Fri, 08 Feb 2019 22:30:48 +0000
changeset 458617 87194c6797c2a69c9e71dc33af86e7c264a589c8
parent 458616 944a5d9d7f54085c053ef96d3ba15338545ceae9
child 458618 9959d6380a99843b68b98c3d6b06419b76e8b2bf
push id77936
push userluca.greco@alcacoop.it
push dateTue, 12 Feb 2019 01:09:52 +0000
treeherderautoland@9959d6380a99 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerszombie
bugs1525200
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 1525200 - Fix history webextension API failing to load when loaded after the bookmarks API. r=zombie This patch changes ext-history.js and ext-browsingData.js to ensure that these API modules are importing PlacesUtils in the same way as ext-bookmarks.js, because mixing CU.defineModuleGetter and CU.import would raise an error and it would break those two WebExtensions APIs if the ext-bookmarks.js gets loaded first. Differential Revision: https://phabricator.services.mozilla.com/D18683
browser/components/extensions/parent/ext-browsingData.js
browser/components/extensions/parent/ext-history.js
--- a/browser/components/extensions/parent/ext-browsingData.js
+++ b/browser/components/extensions/parent/ext-browsingData.js
@@ -1,15 +1,15 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
 
-ChromeUtils.defineModuleGetter(this, "PlacesUtils",
-                               "resource://gre/modules/PlacesUtils.jsm");
+var {PlacesUtils} = ChromeUtils.import("resource://gre/modules/PlacesUtils.jsm");
+
 ChromeUtils.defineModuleGetter(this, "Preferences",
                                "resource://gre/modules/Preferences.jsm");
 ChromeUtils.defineModuleGetter(this, "Sanitizer",
                                "resource:///modules/Sanitizer.jsm");
 ChromeUtils.defineModuleGetter(this, "Services",
                                "resource://gre/modules/Services.jsm");
 ChromeUtils.defineModuleGetter(this, "setTimeout",
                                "resource://gre/modules/Timer.jsm");
--- a/browser/components/extensions/parent/ext-history.js
+++ b/browser/components/extensions/parent/ext-history.js
@@ -1,14 +1,14 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
-ChromeUtils.defineModuleGetter(this, "PlacesUtils",
-                               "resource://gre/modules/PlacesUtils.jsm");
+var {PlacesUtils} = ChromeUtils.import("resource://gre/modules/PlacesUtils.jsm");
+
 ChromeUtils.defineModuleGetter(this, "Services",
                                "resource://gre/modules/Services.jsm");
 
 var {
   normalizeTime,
 } = ExtensionCommon;
 
 let nsINavHistoryService = Ci.nsINavHistoryService;