2020-08-24 01:24:05 +03:00
|
|
|
/* 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/. */
|
|
|
|
|
2020-09-14 21:26:23 +03:00
|
|
|
"use strict";
|
|
|
|
|
2021-04-22 22:27:55 +03:00
|
|
|
var EXPORTED_SYMBOLS = ["AboutNewTabParent"];
|
2020-09-14 21:26:23 +03:00
|
|
|
|
|
|
|
const { XPCOMUtils } = ChromeUtils.import(
|
|
|
|
"resource://gre/modules/XPCOMUtils.jsm"
|
|
|
|
);
|
2020-08-24 01:24:05 +03:00
|
|
|
|
|
|
|
XPCOMUtils.defineLazyModuleGetters(this, {
|
2021-02-02 01:01:52 +03:00
|
|
|
ASRouter: "resource://activity-stream/lib/ASRouter.jsm",
|
2020-08-24 01:24:05 +03:00
|
|
|
});
|
|
|
|
|
2020-09-14 21:26:23 +03:00
|
|
|
class AboutNewTabParent extends JSWindowActorParent {
|
|
|
|
async receiveMessage(message) {
|
|
|
|
switch (message.name) {
|
2021-04-22 22:27:55 +03:00
|
|
|
case "AboutNewTabVisible":
|
|
|
|
await ASRouter.waitForInitialized;
|
|
|
|
ASRouter.sendTriggerMessage({
|
|
|
|
browser: this.browsingContext.top.embedderElement,
|
|
|
|
// triggerId and triggerContext
|
|
|
|
id: "defaultBrowserCheck",
|
|
|
|
context: { source: "newtab" },
|
|
|
|
});
|
2020-08-27 20:57:25 +03:00
|
|
|
}
|
2020-09-14 21:26:23 +03:00
|
|
|
}
|
|
|
|
}
|