Merge remote-tracking branch 'mozilla/central'

This commit is contained in:
Ed Lee 2019-01-29 15:16:53 -08:00
Родитель 0c323af6d9 01a4d1659b
Коммит 03ecafe436
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 40B7250312F03605
57 изменённых файлов: 206 добавлений и 183 удалений

Просмотреть файл

@ -6,10 +6,10 @@
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/AppConstants.jsm"); const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
ChromeUtils.import("resource://gre/modules/E10SUtils.jsm"); const {E10SUtils} = ChromeUtils.import("resource://gre/modules/E10SUtils.jsm");
ChromeUtils.defineModuleGetter(this, "AboutNewTab", ChromeUtils.defineModuleGetter(this, "AboutNewTab",
"resource:///modules/AboutNewTab.jsm"); "resource:///modules/AboutNewTab.jsm");

Просмотреть файл

@ -1,17 +1,19 @@
/* globals Services */
"use strict"; "use strict";
/* istanbul ignore if */
if (typeof ChromeUtils !== "undefined") { if (typeof ChromeUtils !== "undefined") {
ChromeUtils.import("resource://gre/modules/Services.jsm"); // Use a var here instead of let outside to avoid creating a locally scoped
// variable that hides the global, which we modify for testing.
// eslint-disable-next-line no-var, vars-on-top
var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
} }
let usablePerfObj; let usablePerfObj;
/* istanbul ignore if */
/* istanbul ignore else */ /* istanbul ignore else */
// eslint-disable-next-line block-scoped-var
if (typeof Services !== "undefined") { if (typeof Services !== "undefined") {
// Borrow the high-resolution timer from the hidden window.... // Borrow the high-resolution timer from the hidden window....
// eslint-disable-next-line block-scoped-var
usablePerfObj = Services.appShell.hiddenDOMWindow.performance; usablePerfObj = Services.appShell.hiddenDOMWindow.performance;
} else if (typeof performance !== "undefined") { } else if (typeof performance !== "undefined") {
// we must be running in content space // we must be running in content space

Просмотреть файл

@ -3,8 +3,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
const {actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {}); const {actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm");
const {Dedupe} = ChromeUtils.import("resource://activity-stream/common/Dedupe.jsm", {}); const {Dedupe} = ChromeUtils.import("resource://activity-stream/common/Dedupe.jsm");
const TOP_SITES_DEFAULT_ROWS = 1; const TOP_SITES_DEFAULT_ROWS = 1;
const TOP_SITES_MAX_SITES_PER_ROW = 8; const TOP_SITES_MAX_SITES_PER_ROW = 8;

Просмотреть файл

@ -91,7 +91,7 @@ module.exports = function(config) {
options: { options: {
plugins: [ plugins: [
// Converts .jsm files into common-js modules // Converts .jsm files into common-js modules
["jsm-to-commonjs", {basePath: PATHS.resourcePathRegEx, replace: true}], // require("babel-plugin-jsm-to-commonjs") ["jsm-to-commonjs", {basePath: PATHS.resourcePathRegEx, removeOtherImports: true, replace: true}], // require("babel-plugin-jsm-to-commonjs")
["transform-async-to-module-method", {module: "co-task", method: "async"}], // require("babel-plugin-transform-async-to-module-method") ["transform-async-to-module-method", {module: "co-task", method: "async"}], // require("babel-plugin-transform-async-to-module-method")
"transform-es2015-modules-commonjs", // require("babel-plugin-transform-es2015-modules-commonjs") "transform-es2015-modules-commonjs", // require("babel-plugin-transform-es2015-modules-commonjs")
["transform-object-rest-spread", {"useBuiltIns": true}], // require("babel-plugin-transform-object-rest-spread") ["transform-object-rest-spread", {"useBuiltIns": true}], // require("babel-plugin-transform-object-rest-spread")

Просмотреть файл

@ -3,8 +3,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyGlobalGetters(this, ["fetch"]); XPCOMUtils.defineLazyGlobalGetters(this, ["fetch"]);
XPCOMUtils.defineLazyModuleGetters(this, { XPCOMUtils.defineLazyModuleGetters(this, {
AddonManager: "resource://gre/modules/AddonManager.jsm", AddonManager: "resource://gre/modules/AddonManager.jsm",
@ -13,12 +13,12 @@ XPCOMUtils.defineLazyModuleGetters(this, {
AppConstants: "resource://gre/modules/AppConstants.jsm", AppConstants: "resource://gre/modules/AppConstants.jsm",
OS: "resource://gre/modules/osfile.jsm", OS: "resource://gre/modules/osfile.jsm",
}); });
const {ASRouterActions: ra, actionTypes: at, actionCreators: ac} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {}); const {ASRouterActions: ra, actionTypes: at, actionCreators: ac} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm");
const {CFRMessageProvider} = ChromeUtils.import("resource://activity-stream/lib/CFRMessageProvider.jsm", {}); const {CFRMessageProvider} = ChromeUtils.import("resource://activity-stream/lib/CFRMessageProvider.jsm");
const {OnboardingMessageProvider} = ChromeUtils.import("resource://activity-stream/lib/OnboardingMessageProvider.jsm", {}); const {OnboardingMessageProvider} = ChromeUtils.import("resource://activity-stream/lib/OnboardingMessageProvider.jsm");
const {SnippetsTestMessageProvider} = ChromeUtils.import("resource://activity-stream/lib/SnippetsTestMessageProvider.jsm", {}); const {SnippetsTestMessageProvider} = ChromeUtils.import("resource://activity-stream/lib/SnippetsTestMessageProvider.jsm");
const {RemoteSettings} = ChromeUtils.import("resource://services-settings/remote-settings.js", {}); const {RemoteSettings} = ChromeUtils.import("resource://services-settings/remote-settings.js");
const {CFRPageActions} = ChromeUtils.import("resource://activity-stream/lib/CFRPageActions.jsm", {}); const {CFRPageActions} = ChromeUtils.import("resource://activity-stream/lib/CFRPageActions.jsm");
ChromeUtils.defineModuleGetter(this, "ASRouterPreferences", ChromeUtils.defineModuleGetter(this, "ASRouterPreferences",
"resource://activity-stream/lib/ASRouterPreferences.jsm"); "resource://activity-stream/lib/ASRouterPreferences.jsm");
@ -28,7 +28,7 @@ ChromeUtils.defineModuleGetter(this, "QueryCache",
"resource://activity-stream/lib/ASRouterTargeting.jsm"); "resource://activity-stream/lib/ASRouterTargeting.jsm");
ChromeUtils.defineModuleGetter(this, "ASRouterTriggerListeners", ChromeUtils.defineModuleGetter(this, "ASRouterTriggerListeners",
"resource://activity-stream/lib/ASRouterTriggerListeners.jsm"); "resource://activity-stream/lib/ASRouterTriggerListeners.jsm");
ChromeUtils.import("resource:///modules/AttributionCode.jsm"); const {AttributionCode} = ChromeUtils.import("resource:///modules/AttributionCode.jsm");
const INCOMING_MESSAGE_NAME = "ASRouter:child-to-parent"; const INCOMING_MESSAGE_NAME = "ASRouter:child-to-parent";
const OUTGOING_MESSAGE_NAME = "ASRouter:parent-to-child"; const OUTGOING_MESSAGE_NAME = "ASRouter:parent-to-child";

Просмотреть файл

@ -1,5 +1,5 @@
const {actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {}); const {actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm");
const {ASRouter} = ChromeUtils.import("resource://activity-stream/lib/ASRouter.jsm", {}); const {ASRouter} = ChromeUtils.import("resource://activity-stream/lib/ASRouter.jsm");
/** /**
* @class ASRouterFeed - Connects ASRouter singleton (see above) to Activity Stream's * @class ASRouterFeed - Connects ASRouter singleton (see above) to Activity Stream's

Просмотреть файл

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
const PROVIDER_PREF_BRANCH = "browser.newtabpage.activity-stream.asrouter.providers."; const PROVIDER_PREF_BRANCH = "browser.newtabpage.activity-stream.asrouter.providers.";
const DEVTOOLS_PREF = "browser.newtabpage.activity-stream.asrouter.devtoolsEnabled"; const DEVTOOLS_PREF = "browser.newtabpage.activity-stream.asrouter.devtoolsEnabled";

Просмотреть файл

@ -1,5 +1,5 @@
ChromeUtils.import("resource://gre/modules/components-utils/FilterExpressions.jsm"); const {FilterExpressions} = ChromeUtils.import("resource://gre/modules/components-utils/FilterExpressions.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.defineModuleGetter(this, "ASRouterPreferences", ChromeUtils.defineModuleGetter(this, "ASRouterPreferences",
"resource://activity-stream/lib/ASRouterPreferences.jsm"); "resource://activity-stream/lib/ASRouterPreferences.jsm");

Просмотреть файл

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.defineModuleGetter(this, "PrivateBrowsingUtils", ChromeUtils.defineModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm"); "resource://gre/modules/PrivateBrowsingUtils.jsm");

Просмотреть файл

@ -3,10 +3,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.defineModuleGetter(this, "PluralForm", "resource://gre/modules/PluralForm.jsm"); ChromeUtils.defineModuleGetter(this, "PluralForm", "resource://gre/modules/PluralForm.jsm");
const {actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {}); const {actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm");
XPCOMUtils.defineLazyGlobalGetters(this, ["fetch"]); XPCOMUtils.defineLazyGlobalGetters(this, ["fetch"]);

Просмотреть файл

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.defineModuleGetter(this, "AppConstants", ChromeUtils.defineModuleGetter(this, "AppConstants",
"resource://gre/modules/AppConstants.jsm"); "resource://gre/modules/AppConstants.jsm");
@ -12,24 +12,24 @@ ChromeUtils.defineModuleGetter(this, "UpdateUtils",
// NB: Eagerly load modules that will be loaded/constructed/initialized in the // NB: Eagerly load modules that will be loaded/constructed/initialized in the
// common case to avoid the overhead of wrapping and detecting lazy loading. // common case to avoid the overhead of wrapping and detecting lazy loading.
const {actionCreators: ac, actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {}); const {actionCreators: ac, actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm");
const {AboutPreferences} = ChromeUtils.import("resource://activity-stream/lib/AboutPreferences.jsm", {}); const {AboutPreferences} = ChromeUtils.import("resource://activity-stream/lib/AboutPreferences.jsm");
const {DefaultPrefs} = ChromeUtils.import("resource://activity-stream/lib/ActivityStreamPrefs.jsm", {}); const {DefaultPrefs} = ChromeUtils.import("resource://activity-stream/lib/ActivityStreamPrefs.jsm");
const {ManualMigration} = ChromeUtils.import("resource://activity-stream/lib/ManualMigration.jsm", {}); const {ManualMigration} = ChromeUtils.import("resource://activity-stream/lib/ManualMigration.jsm");
const {NewTabInit} = ChromeUtils.import("resource://activity-stream/lib/NewTabInit.jsm", {}); const {NewTabInit} = ChromeUtils.import("resource://activity-stream/lib/NewTabInit.jsm");
const {SectionsFeed} = ChromeUtils.import("resource://activity-stream/lib/SectionsManager.jsm", {}); const {SectionsFeed} = ChromeUtils.import("resource://activity-stream/lib/SectionsManager.jsm");
const {PlacesFeed} = ChromeUtils.import("resource://activity-stream/lib/PlacesFeed.jsm", {}); const {PlacesFeed} = ChromeUtils.import("resource://activity-stream/lib/PlacesFeed.jsm");
const {PrefsFeed} = ChromeUtils.import("resource://activity-stream/lib/PrefsFeed.jsm", {}); const {PrefsFeed} = ChromeUtils.import("resource://activity-stream/lib/PrefsFeed.jsm");
const {Store} = ChromeUtils.import("resource://activity-stream/lib/Store.jsm", {}); const {Store} = ChromeUtils.import("resource://activity-stream/lib/Store.jsm");
const {SnippetsFeed} = ChromeUtils.import("resource://activity-stream/lib/SnippetsFeed.jsm", {}); const {SnippetsFeed} = ChromeUtils.import("resource://activity-stream/lib/SnippetsFeed.jsm");
const {SystemTickFeed} = ChromeUtils.import("resource://activity-stream/lib/SystemTickFeed.jsm", {}); const {SystemTickFeed} = ChromeUtils.import("resource://activity-stream/lib/SystemTickFeed.jsm");
const {TelemetryFeed} = ChromeUtils.import("resource://activity-stream/lib/TelemetryFeed.jsm", {}); const {TelemetryFeed} = ChromeUtils.import("resource://activity-stream/lib/TelemetryFeed.jsm");
const {FaviconFeed} = ChromeUtils.import("resource://activity-stream/lib/FaviconFeed.jsm", {}); const {FaviconFeed} = ChromeUtils.import("resource://activity-stream/lib/FaviconFeed.jsm");
const {TopSitesFeed} = ChromeUtils.import("resource://activity-stream/lib/TopSitesFeed.jsm", {}); const {TopSitesFeed} = ChromeUtils.import("resource://activity-stream/lib/TopSitesFeed.jsm");
const {TopStoriesFeed} = ChromeUtils.import("resource://activity-stream/lib/TopStoriesFeed.jsm", {}); const {TopStoriesFeed} = ChromeUtils.import("resource://activity-stream/lib/TopStoriesFeed.jsm");
const {HighlightsFeed} = ChromeUtils.import("resource://activity-stream/lib/HighlightsFeed.jsm", {}); const {HighlightsFeed} = ChromeUtils.import("resource://activity-stream/lib/HighlightsFeed.jsm");
const {ASRouterFeed} = ChromeUtils.import("resource://activity-stream/lib/ASRouterFeed.jsm", {}); const {ASRouterFeed} = ChromeUtils.import("resource://activity-stream/lib/ASRouterFeed.jsm");
const {DiscoveryStreamFeed} = ChromeUtils.import("resource://activity-stream/lib/DiscoveryStreamFeed.jsm", {}); const {DiscoveryStreamFeed} = ChromeUtils.import("resource://activity-stream/lib/DiscoveryStreamFeed.jsm");
const DEFAULT_SITES = new Map([ const DEFAULT_SITES = new Map([
// This first item is the global list fallback for any unexpected geos // This first item is the global list fallback for any unexpected geos

Просмотреть файл

@ -4,11 +4,11 @@
"use strict"; "use strict";
ChromeUtils.import("resource:///modules/AboutNewTab.jsm"); const {AboutNewTab} = ChromeUtils.import("resource:///modules/AboutNewTab.jsm");
/* globals RemotePages */ // Remove when updating eslint-plugin-mozilla 0.14.0+ /* globals RemotePages */ // Remove when updating eslint-plugin-mozilla 0.14.0+
ChromeUtils.import("resource://gre/modules/remotepagemanager/RemotePageManagerParent.jsm"); const {RemotePages} = ChromeUtils.import("resource://gre/modules/remotepagemanager/RemotePageManagerParent.jsm");
const {actionCreators: ac, actionTypes: at, actionUtils: au} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {}); const {actionCreators: ac, actionTypes: at, actionUtils: au} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm");
const ABOUT_NEW_TAB_URL = "about:newtab"; const ABOUT_NEW_TAB_URL = "about:newtab";
const ABOUT_HOME_URL = "about:home"; const ABOUT_HOME_URL = "about:home";

Просмотреть файл

@ -3,8 +3,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/AppConstants.jsm"); const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
ChromeUtils.import("resource://gre/modules/Preferences.jsm"); const {Preferences} = ChromeUtils.import("resource://gre/modules/Preferences.jsm");
const ACTIVITY_STREAM_PREF_BRANCH = "browser.newtabpage.activity-stream."; const ACTIVITY_STREAM_PREF_BRANCH = "browser.newtabpage.activity-stream.";

Просмотреть файл

@ -3,9 +3,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/Localization.jsm"); const {Localization} = ChromeUtils.import("resource://gre/modules/Localization.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyGlobalGetters(this, ["fetch"]); XPCOMUtils.defineLazyGlobalGetters(this, ["fetch"]);
ChromeUtils.defineModuleGetter(this, "PrivateBrowsingUtils", ChromeUtils.defineModuleGetter(this, "PrivateBrowsingUtils",

Просмотреть файл

@ -3,12 +3,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyGlobalGetters(this, ["fetch"]); XPCOMUtils.defineLazyGlobalGetters(this, ["fetch"]);
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
const {actionTypes: at, actionCreators: ac} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {}); const {actionTypes: at, actionCreators: ac} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm");
const {PersistentCache} = ChromeUtils.import("resource://activity-stream/lib/PersistentCache.jsm", {}); const {PersistentCache} = ChromeUtils.import("resource://activity-stream/lib/PersistentCache.jsm");
const CACHE_KEY = "discovery_stream"; const CACHE_KEY = "discovery_stream";
const LAYOUT_UPDATE_TIME = 30 * 60 * 1000; // 30 minutes const LAYOUT_UPDATE_TIME = 30 * 60 * 1000; // 30 minutes

Просмотреть файл

@ -1,8 +1,8 @@
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyGlobalGetters(this, ["URL"]); XPCOMUtils.defineLazyGlobalGetters(this, ["URL"]);
const {actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {}); const {actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm");
XPCOMUtils.defineLazyModuleGetters(this, { XPCOMUtils.defineLazyModuleGetters(this, {
DownloadsCommon: "resource:///modules/DownloadsCommon.jsm", DownloadsCommon: "resource:///modules/DownloadsCommon.jsm",

Просмотреть файл

@ -3,9 +3,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
const {actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {}); const {actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm");
const {getDomain} = ChromeUtils.import("resource://activity-stream/lib/TippyTopProvider.jsm", {}); const {getDomain} = ChromeUtils.import("resource://activity-stream/lib/TippyTopProvider.jsm");
const {RemoteSettings} = ChromeUtils.import("resource://services-settings/remote-settings.js", {}); const {RemoteSettings} = ChromeUtils.import("resource://services-settings/remote-settings.js");
ChromeUtils.defineModuleGetter(this, "PlacesUtils", ChromeUtils.defineModuleGetter(this, "PlacesUtils",
"resource://gre/modules/PlacesUtils.jsm"); "resource://gre/modules/PlacesUtils.jsm");

Просмотреть файл

@ -325,6 +325,7 @@ gAdultSet = new Set([
"3xw8+0/WU51Yz4TWIMK8mw==", "3xw8+0/WU51Yz4TWIMK8mw==",
"3y5Xk65ShGvWFbQxcZaQAQ==", "3y5Xk65ShGvWFbQxcZaQAQ==",
"3yDD+xT8iRfUVdxcc7RxKw==", "3yDD+xT8iRfUVdxcc7RxKw==",
"3yavzOJ1mM44pOSFLLszgA==",
"4+htiqjEz9oq0YcI/ErBVg==", "4+htiqjEz9oq0YcI/ErBVg==",
"40HzgVKYnqIb6NJhpSIF0A==", "40HzgVKYnqIb6NJhpSIF0A==",
"40gCrW4YWi+2lkqMSPKBPg==", "40gCrW4YWi+2lkqMSPKBPg==",

Просмотреть файл

@ -3,14 +3,14 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
const {actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {}); const {actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm");
const {shortURL} = ChromeUtils.import("resource://activity-stream/lib/ShortURL.jsm", {}); const {shortURL} = ChromeUtils.import("resource://activity-stream/lib/ShortURL.jsm");
const {SectionsManager} = ChromeUtils.import("resource://activity-stream/lib/SectionsManager.jsm", {}); const {SectionsManager} = ChromeUtils.import("resource://activity-stream/lib/SectionsManager.jsm");
const {TOP_SITES_DEFAULT_ROWS, TOP_SITES_MAX_SITES_PER_ROW} = ChromeUtils.import("resource://activity-stream/common/Reducers.jsm", {}); const {TOP_SITES_DEFAULT_ROWS, TOP_SITES_MAX_SITES_PER_ROW} = ChromeUtils.import("resource://activity-stream/common/Reducers.jsm");
const {Dedupe} = ChromeUtils.import("resource://activity-stream/common/Dedupe.jsm", {}); const {Dedupe} = ChromeUtils.import("resource://activity-stream/common/Dedupe.jsm");
ChromeUtils.defineModuleGetter(this, "filterAdult", ChromeUtils.defineModuleGetter(this, "filterAdult",
"resource://activity-stream/lib/FilterAdult.jsm"); "resource://activity-stream/lib/FilterAdult.jsm");

Просмотреть файл

@ -3,12 +3,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
const {actionCreators: ac, actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {}); const {actionCreators: ac, actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm");
const MIGRATION_ENDED_EVENT = "Migration:Ended"; const MIGRATION_ENDED_EVENT = "Migration:Ended";
const MS_PER_DAY = 86400000; const MS_PER_DAY = 86400000;
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.defineModuleGetter(this, "MigrationUtils", "resource:///modules/MigrationUtils.jsm"); ChromeUtils.defineModuleGetter(this, "MigrationUtils", "resource:///modules/MigrationUtils.jsm");
ChromeUtils.defineModuleGetter(this, "ProfileAge", "resource://gre/modules/ProfileAge.jsm"); ChromeUtils.defineModuleGetter(this, "ProfileAge", "resource://gre/modules/ProfileAge.jsm");

Просмотреть файл

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
const {toksToTfIdfVector} = ChromeUtils.import("resource://activity-stream/lib/Tokenize.jsm", {}); const {toksToTfIdfVector} = ChromeUtils.import("resource://activity-stream/lib/Tokenize.jsm");
this.NaiveBayesTextTagger = class NaiveBayesTextTagger { this.NaiveBayesTextTagger = class NaiveBayesTextTagger {
constructor(model) { constructor(model) {

Просмотреть файл

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
const {actionCreators: ac, actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {}); const {actionCreators: ac, actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm");
/** /**
* NewTabInit - A placeholder for now. This will send a copy of the state to all * NewTabInit - A placeholder for now. This will send a copy of the state to all

Просмотреть файл

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
const {toksToTfIdfVector} = ChromeUtils.import("resource://activity-stream/lib/Tokenize.jsm", {}); const {toksToTfIdfVector} = ChromeUtils.import("resource://activity-stream/lib/Tokenize.jsm");
this.NmfTextTagger = class NmfTextTagger { this.NmfTextTagger = class NmfTextTagger {
constructor(model) { constructor(model) {

Просмотреть файл

@ -2,10 +2,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/Localization.jsm"); const {Localization} = ChromeUtils.import("resource://gre/modules/Localization.jsm");
ChromeUtils.import("resource://gre/modules/FxAccountsConfig.jsm"); const {FxAccountsConfig} = ChromeUtils.import("resource://gre/modules/FxAccountsConfig.jsm");
ChromeUtils.import("resource:///modules/AttributionCode.jsm"); const {AttributionCode} = ChromeUtils.import("resource:///modules/AttributionCode.jsm");
ChromeUtils.import("resource://gre/modules/addons/AddonRepository.jsm"); const {AddonRepository} = ChromeUtils.import("resource://gre/modules/addons/AddonRepository.jsm");
async function getAddonInfo() { async function getAddonInfo() {
try { try {

Просмотреть файл

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.defineModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm"); ChromeUtils.defineModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm");
XPCOMUtils.defineLazyGetter(this, "gTextDecoder", () => new TextDecoder()); XPCOMUtils.defineLazyGetter(this, "gTextDecoder", () => new TextDecoder());

Просмотреть файл

@ -3,20 +3,20 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
const {RemoteSettings} = ChromeUtils.import("resource://services-settings/remote-settings.js", {}); const {RemoteSettings} = ChromeUtils.import("resource://services-settings/remote-settings.js");
const {actionCreators: ac} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {}); const {actionCreators: ac} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm");
ChromeUtils.defineModuleGetter(this, "perfService", "resource://activity-stream/common/PerfService.jsm"); ChromeUtils.defineModuleGetter(this, "perfService", "resource://activity-stream/common/PerfService.jsm");
const {NaiveBayesTextTagger} = ChromeUtils.import("resource://activity-stream/lib/NaiveBayesTextTagger.jsm", {}); const {NaiveBayesTextTagger} = ChromeUtils.import("resource://activity-stream/lib/NaiveBayesTextTagger.jsm");
const {NmfTextTagger} = ChromeUtils.import("resource://activity-stream/lib/NmfTextTagger.jsm", {}); const {NmfTextTagger} = ChromeUtils.import("resource://activity-stream/lib/NmfTextTagger.jsm");
const {RecipeExecutor} = ChromeUtils.import("resource://activity-stream/lib/RecipeExecutor.jsm", {}); const {RecipeExecutor} = ChromeUtils.import("resource://activity-stream/lib/RecipeExecutor.jsm");
ChromeUtils.defineModuleGetter(this, "NewTabUtils", ChromeUtils.defineModuleGetter(this, "NewTabUtils",
"resource://gre/modules/NewTabUtils.jsm"); "resource://gre/modules/NewTabUtils.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.defineModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm"); ChromeUtils.defineModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm");
XPCOMUtils.defineLazyGlobalGetters(this, ["fetch"]); XPCOMUtils.defineLazyGlobalGetters(this, ["fetch"]);

Просмотреть файл

@ -3,9 +3,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
const {actionCreators: ac, actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {}); const {actionCreators: ac, actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm");
ChromeUtils.defineModuleGetter(this, "NewTabUtils", ChromeUtils.defineModuleGetter(this, "NewTabUtils",
"resource://gre/modules/NewTabUtils.jsm"); "resource://gre/modules/NewTabUtils.jsm");

Просмотреть файл

@ -3,10 +3,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
const {actionCreators: ac, actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {}); const {actionCreators: ac, actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm");
const {Prefs} = ChromeUtils.import("resource://activity-stream/lib/ActivityStreamPrefs.jsm", {}); const {Prefs} = ChromeUtils.import("resource://activity-stream/lib/ActivityStreamPrefs.jsm");
const {PrerenderData} = ChromeUtils.import("resource://activity-stream/common/PrerenderData.jsm", {}); const {PrerenderData} = ChromeUtils.import("resource://activity-stream/common/PrerenderData.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.defineModuleGetter(this, "PrivateBrowsingUtils", ChromeUtils.defineModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm"); "resource://gre/modules/PrivateBrowsingUtils.jsm");

Просмотреть файл

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
const {tokenize} = ChromeUtils.import("resource://activity-stream/lib/Tokenize.jsm", {}); const {tokenize} = ChromeUtils.import("resource://activity-stream/lib/Tokenize.jsm");
/** /**
* RecipeExecutor is the core feature engineering pipeline for the in-browser * RecipeExecutor is the core feature engineering pipeline for the in-browser

Просмотреть файл

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
// List of sites we match against Topsites in order to identify sites // List of sites we match against Topsites in order to identify sites
// that should be converted to search Topsites // that should be converted to search Topsites

Просмотреть файл

@ -3,10 +3,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/EventEmitter.jsm"); const {EventEmitter} = ChromeUtils.import("resource://gre/modules/EventEmitter.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
const {actionCreators: ac, actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {}); const {actionCreators: ac, actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm");
const {getDefaultOptions} = ChromeUtils.import("resource://activity-stream/lib/ActivityStreamStorage.jsm", {}); const {getDefaultOptions} = ChromeUtils.import("resource://activity-stream/lib/ActivityStreamStorage.jsm");
ChromeUtils.defineModuleGetter(this, "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm"); ChromeUtils.defineModuleGetter(this, "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");

Просмотреть файл

@ -1,5 +1,5 @@
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "IDNService", "@mozilla.org/network/idn-service;1", "nsIIDNService"); XPCOMUtils.defineLazyServiceGetter(this, "IDNService", "@mozilla.org/network/idn-service;1", "nsIIDNService");

Просмотреть файл

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
const {RemoteSettings} = ChromeUtils.import("resource://services-settings/remote-settings.js", {}); const {RemoteSettings} = ChromeUtils.import("resource://services-settings/remote-settings.js");
// Returns whether the passed in params match the criteria. // Returns whether the passed in params match the criteria.
// To match, they must contain all the params specified in criteria and the values // To match, they must contain all the params specified in criteria and the values

Просмотреть файл

@ -3,8 +3,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
const {actionTypes: at, actionCreators: ac} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {}); const {actionTypes: at, actionCreators: ac} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm");
ChromeUtils.defineModuleGetter(this, "AddonManager", ChromeUtils.defineModuleGetter(this, "AddonManager",
"resource://gre/modules/AddonManager.jsm"); "resource://gre/modules/AddonManager.jsm");

Просмотреть файл

@ -3,11 +3,11 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
const {ActivityStreamMessageChannel} = ChromeUtils.import("resource://activity-stream/lib/ActivityStreamMessageChannel.jsm", {}); const {ActivityStreamMessageChannel} = ChromeUtils.import("resource://activity-stream/lib/ActivityStreamMessageChannel.jsm");
const {ActivityStreamStorage} = ChromeUtils.import("resource://activity-stream/lib/ActivityStreamStorage.jsm", {}); const {ActivityStreamStorage} = ChromeUtils.import("resource://activity-stream/lib/ActivityStreamStorage.jsm");
const {Prefs} = ChromeUtils.import("resource://activity-stream/lib/ActivityStreamPrefs.jsm", {}); const {Prefs} = ChromeUtils.import("resource://activity-stream/lib/ActivityStreamPrefs.jsm");
const {reducers} = ChromeUtils.import("resource://activity-stream/common/Reducers.jsm", {}); const {reducers} = ChromeUtils.import("resource://activity-stream/common/Reducers.jsm");
const {redux} = ChromeUtils.import("resource://activity-stream/vendor/Redux.jsm", {}); const {redux} = ChromeUtils.import("resource://activity-stream/vendor/Redux.jsm");
/** /**
* Store - This has a similar structure to a redux store, but includes some extra * Store - This has a similar structure to a redux store, but includes some extra

Просмотреть файл

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
const {actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {}); const {actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm");
ChromeUtils.defineModuleGetter(this, "setInterval", "resource://gre/modules/Timer.jsm"); ChromeUtils.defineModuleGetter(this, "setInterval", "resource://gre/modules/Timer.jsm");
ChromeUtils.defineModuleGetter(this, "clearInterval", "resource://gre/modules/Timer.jsm"); ChromeUtils.defineModuleGetter(this, "clearInterval", "resource://gre/modules/Timer.jsm");

Просмотреть файл

@ -5,12 +5,12 @@
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
const {actionTypes: at, actionUtils: au} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {}); const {actionTypes: at, actionUtils: au} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm");
const {Prefs} = ChromeUtils.import("resource://activity-stream/lib/ActivityStreamPrefs.jsm", {}); const {Prefs} = ChromeUtils.import("resource://activity-stream/lib/ActivityStreamPrefs.jsm");
const {classifySite} = ChromeUtils.import("resource://activity-stream/lib/SiteClassifier.jsm", {}); const {classifySite} = ChromeUtils.import("resource://activity-stream/lib/SiteClassifier.jsm");
ChromeUtils.defineModuleGetter(this, "ASRouterPreferences", ChromeUtils.defineModuleGetter(this, "ASRouterPreferences",
"resource://activity-stream/lib/ASRouterPreferences.jsm"); "resource://activity-stream/lib/ASRouterPreferences.jsm");

Просмотреть файл

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyGlobalGetters(this, ["fetch", "URL"]); XPCOMUtils.defineLazyGlobalGetters(this, ["fetch", "URL"]);

Просмотреть файл

@ -3,15 +3,15 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
const {actionCreators: ac, actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {}); const {actionCreators: ac, actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm");
const {TippyTopProvider} = ChromeUtils.import("resource://activity-stream/lib/TippyTopProvider.jsm", {}); const {TippyTopProvider} = ChromeUtils.import("resource://activity-stream/lib/TippyTopProvider.jsm");
const {insertPinned, TOP_SITES_MAX_SITES_PER_ROW} = ChromeUtils.import("resource://activity-stream/common/Reducers.jsm", {}); const {insertPinned, TOP_SITES_MAX_SITES_PER_ROW} = ChromeUtils.import("resource://activity-stream/common/Reducers.jsm");
const {Dedupe} = ChromeUtils.import("resource://activity-stream/common/Dedupe.jsm", {}); const {Dedupe} = ChromeUtils.import("resource://activity-stream/common/Dedupe.jsm");
const {shortURL} = ChromeUtils.import("resource://activity-stream/lib/ShortURL.jsm", {}); const {shortURL} = ChromeUtils.import("resource://activity-stream/lib/ShortURL.jsm");
const {getDefaultOptions} = ChromeUtils.import("resource://activity-stream/lib/ActivityStreamStorage.jsm", {}); const {getDefaultOptions} = ChromeUtils.import("resource://activity-stream/lib/ActivityStreamStorage.jsm");
const { const {
CUSTOM_SEARCH_SHORTCUTS, CUSTOM_SEARCH_SHORTCUTS,
SEARCH_SHORTCUTS_EXPERIMENT, SEARCH_SHORTCUTS_EXPERIMENT,
@ -19,7 +19,7 @@ const {
SEARCH_SHORTCUTS_HAVE_PINNED_PREF, SEARCH_SHORTCUTS_HAVE_PINNED_PREF,
checkHasSearchEngine, checkHasSearchEngine,
getSearchProvider, getSearchProvider,
} = ChromeUtils.import("resource://activity-stream/lib/SearchShortcuts.jsm", {}); } = ChromeUtils.import("resource://activity-stream/lib/SearchShortcuts.jsm");
ChromeUtils.defineModuleGetter(this, "filterAdult", ChromeUtils.defineModuleGetter(this, "filterAdult",
"resource://activity-stream/lib/FilterAdult.jsm"); "resource://activity-stream/lib/FilterAdult.jsm");

Просмотреть файл

@ -3,18 +3,18 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/NewTabUtils.jsm"); const {NewTabUtils} = ChromeUtils.import("resource://gre/modules/NewTabUtils.jsm");
XPCOMUtils.defineLazyGlobalGetters(this, ["fetch"]); XPCOMUtils.defineLazyGlobalGetters(this, ["fetch"]);
const {actionTypes: at, actionCreators: ac} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {}); const {actionTypes: at, actionCreators: ac} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm");
const {Prefs} = ChromeUtils.import("resource://activity-stream/lib/ActivityStreamPrefs.jsm", {}); const {Prefs} = ChromeUtils.import("resource://activity-stream/lib/ActivityStreamPrefs.jsm");
const {shortURL} = ChromeUtils.import("resource://activity-stream/lib/ShortURL.jsm", {}); const {shortURL} = ChromeUtils.import("resource://activity-stream/lib/ShortURL.jsm");
const {SectionsManager} = ChromeUtils.import("resource://activity-stream/lib/SectionsManager.jsm", {}); const {SectionsManager} = ChromeUtils.import("resource://activity-stream/lib/SectionsManager.jsm");
const {UserDomainAffinityProvider} = ChromeUtils.import("resource://activity-stream/lib/UserDomainAffinityProvider.jsm", {}); const {UserDomainAffinityProvider} = ChromeUtils.import("resource://activity-stream/lib/UserDomainAffinityProvider.jsm");
const {PersonalityProvider} = ChromeUtils.import("resource://activity-stream/lib/PersonalityProvider.jsm", {}); const {PersonalityProvider} = ChromeUtils.import("resource://activity-stream/lib/PersonalityProvider.jsm");
const {PersistentCache} = ChromeUtils.import("resource://activity-stream/lib/PersistentCache.jsm", {}); const {PersistentCache} = ChromeUtils.import("resource://activity-stream/lib/PersistentCache.jsm");
ChromeUtils.defineModuleGetter(this, "perfService", "resource://activity-stream/common/PerfService.jsm"); ChromeUtils.defineModuleGetter(this, "perfService", "resource://activity-stream/common/PerfService.jsm");
ChromeUtils.defineModuleGetter(this, "pktApi", "chrome://pocket/content/pktApi.jsm"); ChromeUtils.defineModuleGetter(this, "pktApi", "chrome://pocket/content/pktApi.jsm");

Просмотреть файл

@ -5,7 +5,7 @@
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
/** /**
* Note: the schema can be found in * Note: the schema can be found in

Просмотреть файл

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.defineModuleGetter(this, "PlacesUtils", ChromeUtils.defineModuleGetter(this, "PlacesUtils",
"resource://gre/modules/PlacesUtils.jsm"); "resource://gre/modules/PlacesUtils.jsm");

56
package-lock.json сгенерированный
Просмотреть файл

@ -1055,15 +1055,15 @@
} }
}, },
"babel-plugin-jsm-to-commonjs": { "babel-plugin-jsm-to-commonjs": {
"version": "0.4.0", "version": "0.5.0",
"resolved": "https://registry.npmjs.org/babel-plugin-jsm-to-commonjs/-/babel-plugin-jsm-to-commonjs-0.4.0.tgz", "resolved": "https://registry.npmjs.org/babel-plugin-jsm-to-commonjs/-/babel-plugin-jsm-to-commonjs-0.5.0.tgz",
"integrity": "sha1-eBgITBlMWsH/yUokv6Dtxzfxi/s=", "integrity": "sha512-2+84X/eEYxs+ig3ZVfQhcnvFrYPKKCYmdTs6RZp00MKoIOZ2zET3+mK7gyO6IN922oIv6NGrizOtSEJqLxl/RA==",
"dev": true "dev": true
}, },
"babel-plugin-jsm-to-esmodules": { "babel-plugin-jsm-to-esmodules": {
"version": "0.4.0", "version": "0.6.0",
"resolved": "https://registry.npmjs.org/babel-plugin-jsm-to-esmodules/-/babel-plugin-jsm-to-esmodules-0.4.0.tgz", "resolved": "https://registry.npmjs.org/babel-plugin-jsm-to-esmodules/-/babel-plugin-jsm-to-esmodules-0.6.0.tgz",
"integrity": "sha1-UJLJUW/YX7UBGMOPFG4MyA36d8k=", "integrity": "sha512-463Yuq2sLkjoGHl5vPYUQQONnDjxnmxZuhsR1swL5N76hDFGyYZAVd6HoS4E02jBF8bORpS4aFmdr1XjEZ0buQ==",
"dev": true "dev": true
}, },
"babel-plugin-syntax-async-functions": { "babel-plugin-syntax-async-functions": {
@ -3493,14 +3493,50 @@
} }
}, },
"eslint-plugin-mozilla": { "eslint-plugin-mozilla": {
"version": "0.16.3", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-mozilla/-/eslint-plugin-mozilla-0.16.3.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-mozilla/-/eslint-plugin-mozilla-1.1.0.tgz",
"integrity": "sha512-ZvseeV3flenYTZP/B6SUTnwmfMkW99o0FNm3DaM4ZlyahTGXHepmAEPLkwIvY5eKrcRmo8On+kNmUqelDmxwKw==", "integrity": "sha512-LmmwR+/B5MDC/50aGIqMsuRnGBSLjBBHTIfm9IawLap5GHwOWN7BcP0x4AFiWwgUQMr+PScQniW5W+olFLuk+Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"htmlparser2": "3.9.2", "htmlparser2": "3.10.0",
"ini-parser": "0.0.2", "ini-parser": "0.0.2",
"sax": "1.2.4" "sax": "1.2.4"
},
"dependencies": {
"htmlparser2": {
"version": "3.10.0",
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.0.tgz",
"integrity": "sha512-J1nEUGv+MkXS0weHNWVKJJ+UrLfePxRWpN3C9bEi9fLxL2+ggW94DQvgYVXsaT30PGwYRIZKNZXuyMhp3Di4bQ==",
"dev": true,
"requires": {
"domelementtype": "^1.3.0",
"domhandler": "^2.3.0",
"domutils": "^1.5.1",
"entities": "^1.1.1",
"inherits": "^2.0.1",
"readable-stream": "^3.0.6"
}
},
"readable-stream": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.1.1.tgz",
"integrity": "sha512-DkN66hPyqDhnIQ6Jcsvx9bFjhw214O4poMBcIMgPVpQvNy9a0e0Uhg5SqySyDKAmUlwt8LonTBz1ezOnM8pUdA==",
"dev": true,
"requires": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
}
},
"string_decoder": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz",
"integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==",
"dev": true,
"requires": {
"safe-buffer": "~5.1.0"
}
}
} }
}, },
"eslint-plugin-no-unsanitized": { "eslint-plugin-no-unsanitized": {

Просмотреть файл

@ -22,8 +22,8 @@
"babel-core": "6.26.3", "babel-core": "6.26.3",
"babel-eslint": "10.0.1", "babel-eslint": "10.0.1",
"babel-loader": "7.1.4", "babel-loader": "7.1.4",
"babel-plugin-jsm-to-commonjs": "0.4.0", "babel-plugin-jsm-to-commonjs": "0.5.0",
"babel-plugin-jsm-to-esmodules": "0.4.0", "babel-plugin-jsm-to-esmodules": "0.6.0",
"babel-plugin-transform-async-generator-functions": "6.24.1", "babel-plugin-transform-async-generator-functions": "6.24.1",
"babel-plugin-transform-async-to-generator": "6.24.1", "babel-plugin-transform-async-to-generator": "6.24.1",
"babel-plugin-transform-async-to-module-method": "6.24.1", "babel-plugin-transform-async-to-module-method": "6.24.1",
@ -39,7 +39,7 @@
"eslint": "5.9.0", "eslint": "5.9.0",
"eslint-plugin-import": "2.14.0", "eslint-plugin-import": "2.14.0",
"eslint-plugin-json": "1.2.1", "eslint-plugin-json": "1.2.1",
"eslint-plugin-mozilla": "0.16.3", "eslint-plugin-mozilla": "1.1.0",
"eslint-plugin-no-unsanitized": "3.0.2", "eslint-plugin-no-unsanitized": "3.0.2",
"eslint-plugin-promise": "4.0.1", "eslint-plugin-promise": "4.0.1",
"eslint-plugin-react": "7.11.1", "eslint-plugin-react": "7.11.1",

Просмотреть файл

@ -2,8 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyGlobalGetters(this, ["fetch"]); XPCOMUtils.defineLazyGlobalGetters(this, ["fetch"]);
ChromeUtils.defineModuleGetter(this, "AppConstants", ChromeUtils.defineModuleGetter(this, "AppConstants",

Просмотреть файл

@ -1,4 +1,3 @@
ChromeUtils.import("resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService", XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
"@mozilla.org/browser/aboutnewtab-service;1", "@mozilla.org/browser/aboutnewtab-service;1",
"nsIAboutNewTabService"); "nsIAboutNewTabService");

Просмотреть файл

@ -1,9 +1,9 @@
const {CFRPageActions} = const {CFRPageActions} =
ChromeUtils.import("resource://activity-stream/lib/CFRPageActions.jsm", {}); ChromeUtils.import("resource://activity-stream/lib/CFRPageActions.jsm");
const {ASRouterTriggerListeners} = const {ASRouterTriggerListeners} =
ChromeUtils.import("resource://activity-stream/lib/ASRouterTriggerListeners.jsm", {}); ChromeUtils.import("resource://activity-stream/lib/ASRouterTriggerListeners.jsm");
const {ASRouter} = const {ASRouter} =
ChromeUtils.import("resource://activity-stream/lib/ASRouter.jsm", {}); ChromeUtils.import("resource://activity-stream/lib/ASRouter.jsm");
function trigger_cfr_panel(browser, trigger, action = {type: "FOO"}) { // a fake action type will result in the action being ignored function trigger_cfr_panel(browser, trigger, action = {type: "FOO"}) { // a fake action type will result in the action being ignored
return CFRPageActions.addRecommendation( return CFRPageActions.addRecommendation(

Просмотреть файл

@ -1,7 +1,7 @@
const {ASRouterTargeting, QueryCache} = const {ASRouterTargeting, QueryCache} =
ChromeUtils.import("resource://activity-stream/lib/ASRouterTargeting.jsm", {}); ChromeUtils.import("resource://activity-stream/lib/ASRouterTargeting.jsm");
const {AddonTestUtils} = const {AddonTestUtils} =
ChromeUtils.import("resource://testing-common/AddonTestUtils.jsm", {}); ChromeUtils.import("resource://testing-common/AddonTestUtils.jsm");
ChromeUtils.defineModuleGetter(this, "ProfileAge", ChromeUtils.defineModuleGetter(this, "ProfileAge",
"resource://gre/modules/ProfileAge.jsm"); "resource://gre/modules/ProfileAge.jsm");
ChromeUtils.defineModuleGetter(this, "AddonManager", ChromeUtils.defineModuleGetter(this, "AddonManager",

Просмотреть файл

@ -1,6 +1,5 @@
ChromeUtils.defineModuleGetter(this, "ASRouterTriggerListeners", ChromeUtils.defineModuleGetter(this, "ASRouterTriggerListeners",
"resource://activity-stream/lib/ASRouterTriggerListeners.jsm"); "resource://activity-stream/lib/ASRouterTriggerListeners.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.defineModuleGetter(this, "TestUtils", ChromeUtils.defineModuleGetter(this, "TestUtils",
"resource://testing-common/TestUtils.jsm"); "resource://testing-common/TestUtils.jsm");
ChromeUtils.defineModuleGetter(this, "PrivateBrowsingUtils", ChromeUtils.defineModuleGetter(this, "PrivateBrowsingUtils",

Просмотреть файл

@ -1,5 +1,3 @@
ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
function checkSpec(uri, check, message) { function checkSpec(uri, check, message) {
const {spec} = NetUtil.newChannel({ const {spec} = NetUtil.newChannel({
loadUsingSystemPrincipal: true, loadUsingSystemPrincipal: true,

Просмотреть файл

@ -3,8 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
// a blue page // a blue page
const TEST_URL = "https://example.com/browser/browser/components/newtab/test/browser/blue_page.html"; const TEST_URL = "https://example.com/browser/browser/components/newtab/test/browser/blue_page.html";
const XHTMLNS = "http://www.w3.org/1999/xhtml"; const XHTMLNS = "http://www.w3.org/1999/xhtml";

Просмотреть файл

@ -1,8 +1,5 @@
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService", XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
"@mozilla.org/browser/aboutnewtab-service;1", "@mozilla.org/browser/aboutnewtab-service;1",
"nsIAboutNewTabService"); "nsIAboutNewTabService");

Просмотреть файл

@ -1,4 +1,3 @@
ChromeUtils.import("resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService", XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
"@mozilla.org/browser/aboutnewtab-service;1", "@mozilla.org/browser/aboutnewtab-service;1",
"nsIAboutNewTabService"); "nsIAboutNewTabService");

Просмотреть файл

@ -37,12 +37,7 @@ const TEST_GLOBAL = {
ChromeUtils: { ChromeUtils: {
defineModuleGetter() {}, defineModuleGetter() {},
generateQI() { return {}; }, generateQI() { return {}; },
import(str) { import() { return global; },
if (str === "resource://services-settings/remote-settings.js") {
return {RemoteSettings: TEST_GLOBAL.RemoteSettings};
}
return {};
},
}, },
Components: {isSuccessCode: () => true}, Components: {isSuccessCode: () => true},
// eslint-disable-next-line object-shorthand // eslint-disable-next-line object-shorthand

Просмотреть файл

@ -4,9 +4,9 @@
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource:///modules/AttributionCode.jsm"); const {AttributionCode} = ChromeUtils.import("resource:///modules/AttributionCode.jsm");
ChromeUtils.import("resource://activity-stream/lib/ASRouterTargeting.jsm"); const {ASRouterTargeting} = ChromeUtils.import("resource://activity-stream/lib/ASRouterTargeting.jsm");
add_task(async function check_attribution_data() { add_task(async function check_attribution_data() {
// Some setup to fake the correct attribution data // Some setup to fake the correct attribution data

Просмотреть файл

@ -4,10 +4,9 @@
"use strict"; "use strict";
ChromeUtils.import("resource://gre/modules/Services.jsm"); const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/Preferences.jsm"); const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService", XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
"@mozilla.org/browser/aboutnewtab-service;1", "@mozilla.org/browser/aboutnewtab-service;1",
"nsIAboutNewTabService"); "nsIAboutNewTabService");

Просмотреть файл

@ -34,7 +34,7 @@ module.exports = {
exclude: /node_modules/, exclude: /node_modules/,
loader: "babel-loader", loader: "babel-loader",
// Converts .jsm files into common-js modules // Converts .jsm files into common-js modules
options: {plugins: [["jsm-to-esmodules", {basePath: resourcePathRegEx, replace: true}], ["transform-object-rest-spread", {"useBuiltIns": true}]]}, options: {plugins: [["jsm-to-esmodules", {basePath: resourcePathRegEx, removeOtherImports: true, replace: true}], ["transform-object-rest-spread", {"useBuiltIns": true}]]},
}, },
], ],
}, },