Skip to content

Commit

Permalink
Bug 1788765 - Convert browser/actors/AboutNewTab* JSM modules to ESMs…
Browse files Browse the repository at this point in the history
… r=mconley

Differential Revision: https://phabricator.services.mozilla.com/D157055
  • Loading branch information
achris16 committed Sep 12, 2022
1 parent 850b97d commit 8eb399b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";

var EXPORTED_SYMBOLS = ["AboutNewTabChild"];
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";

const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"
);
Expand All @@ -30,7 +27,7 @@ XPCOMUtils.defineLazyPreferenceGetter(
false
);

class AboutNewTabChild extends JSWindowActorChild {
export class AboutNewTabChild extends JSWindowActorChild {
handleEvent(event) {
if (event.type == "DOMContentLoaded") {
// If the separate about:welcome page is enabled, we can skip all of this,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,15 @@

"use strict";

var EXPORTED_SYMBOLS = ["AboutNewTabParent"];

const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";

const lazy = {};

XPCOMUtils.defineLazyModuleGetters(lazy, {
ASRouter: "resource://activity-stream/lib/ASRouter.jsm",
});

class AboutNewTabParent extends JSWindowActorParent {
export class AboutNewTabParent extends JSWindowActorParent {
async receiveMessage(message) {
switch (message.name) {
case "AboutNewTabVisible":
Expand Down
4 changes: 2 additions & 2 deletions browser/actors/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ with Files("WebRTCChild.jsm"):
BUG_COMPONENT = ("Firefox", "Site Permissions")

FINAL_TARGET_FILES.actors += [
"AboutNewTabChild.jsm",
"AboutNewTabParent.jsm",
"AboutNewTabChild.sys.mjs",
"AboutNewTabParent.sys.mjs",
"AboutPluginsChild.sys.mjs",
"AboutPluginsParent.sys.mjs",
"AboutPocketChild.jsm",
Expand Down
4 changes: 2 additions & 2 deletions browser/components/BrowserGlue.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,10 @@ let JSWINDOWACTORS = {

AboutNewTab: {
parent: {
moduleURI: "resource:///actors/AboutNewTabParent.jsm",
esModuleURI: "resource:///actors/AboutNewTabParent.sys.mjs",
},
child: {
moduleURI: "resource:///actors/AboutNewTabChild.jsm",
esModuleURI: "resource:///actors/AboutNewTabChild.sys.mjs",
events: {
DOMContentLoaded: {},
pageshow: {},
Expand Down

0 comments on commit 8eb399b

Please sign in to comment.