Bug 1866725 - Convert remaining Actors to ES modules. r=freaktechnik
Differential Revision: https://phabricator.services.mozilla.com/D195322 Depends on D195615 --HG-- rename : mail/actors/LinkClickHandlerChild.jsm => mail/actors/LinkClickHandlerChild.sys.mjs rename : mail/actors/LinkClickHandlerParent.jsm => mail/actors/LinkClickHandlerParent.sys.mjs rename : mail/actors/MailLinkChild.jsm => mail/actors/MailLinkChild.sys.mjs rename : mail/actors/MailLinkParent.jsm => mail/actors/MailLinkParent.sys.mjs rename : mail/actors/PromptParent.jsm => mail/actors/PromptParent.sys.mjs rename : mail/actors/VCardChild.jsm => mail/actors/VCardChild.sys.mjs rename : mail/actors/VCardParent.jsm => mail/actors/VCardParent.sys.mjs extra : rebase_source : 20ec6c453fb4207fe0ebf841a1eb1c60f0136cfb
This commit is contained in:
Родитель
a2778199b0
Коммит
7e3d374e07
|
@ -3,16 +3,7 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = [
|
||||
"LinkClickHandlerChild",
|
||||
"StrictLinkClickHandlerChild",
|
||||
];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
|
@ -74,7 +65,7 @@ function hRefForClickEvent(aEvent) {
|
|||
*
|
||||
* This actor applies to browsers in the "single-site" message manager group.
|
||||
*/
|
||||
class LinkClickHandlerChild extends JSWindowActorChild {
|
||||
export class LinkClickHandlerChild extends JSWindowActorChild {
|
||||
handleEvent(event) {
|
||||
// Don't handle events that:
|
||||
// a) are in the parent process (handled by onclick),
|
||||
|
@ -139,7 +130,7 @@ class LinkClickHandlerChild extends JSWindowActorChild {
|
|||
*
|
||||
* This actor applies to browsers in the "single-page" message manager group.
|
||||
*/
|
||||
class StrictLinkClickHandlerChild extends JSWindowActorChild {
|
||||
export class StrictLinkClickHandlerChild extends JSWindowActorChild {
|
||||
handleEvent(event) {
|
||||
// Don't handle events that:
|
||||
// a) are in the parent process (handled by onclick),
|
|
@ -1,23 +0,0 @@
|
|||
/* vim: set ts=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";
|
||||
|
||||
const EXPORTED_SYMBOLS = [
|
||||
"LinkClickHandlerParent",
|
||||
"StrictLinkClickHandlerParent",
|
||||
];
|
||||
|
||||
const { openLinkExternally } = ChromeUtils.importESModule(
|
||||
"resource:///modules/LinkHelper.sys.mjs"
|
||||
);
|
||||
|
||||
class LinkClickHandlerParent extends JSWindowActorParent {
|
||||
receiveMessage({ data }) {
|
||||
openLinkExternally(data);
|
||||
}
|
||||
}
|
||||
|
||||
class StrictLinkClickHandlerParent extends LinkClickHandlerParent {}
|
|
@ -0,0 +1,14 @@
|
|||
/* vim: set ts=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/. */
|
||||
|
||||
import { openLinkExternally } from "resource:///modules/LinkHelper.sys.mjs";
|
||||
|
||||
export class LinkClickHandlerParent extends JSWindowActorParent {
|
||||
receiveMessage({ data }) {
|
||||
openLinkExternally(data);
|
||||
}
|
||||
}
|
||||
|
||||
export class StrictLinkClickHandlerParent extends LinkClickHandlerParent {}
|
|
@ -3,13 +3,9 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["MailLinkChild"];
|
||||
|
||||
const PROTOCOLS = ["mailto:", "mid:", "news:", "snews:"];
|
||||
|
||||
class MailLinkChild extends JSWindowActorChild {
|
||||
export class MailLinkChild extends JSWindowActorChild {
|
||||
handleEvent(event) {
|
||||
const href = event.target.href;
|
||||
const location = this.document.location;
|
|
@ -3,13 +3,7 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["MailLinkParent"];
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
|
@ -22,7 +16,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
|
|||
MailUtils: "resource:///modules/MailUtils.jsm",
|
||||
});
|
||||
|
||||
class MailLinkParent extends JSWindowActorParent {
|
||||
export class MailLinkParent extends JSWindowActorParent {
|
||||
receiveMessage(value) {
|
||||
switch (value.name) {
|
||||
case "imap:":
|
|
@ -3,10 +3,6 @@
|
|||
* 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";
|
||||
|
||||
var EXPORTED_SYMBOLS = ["PromptParent"];
|
||||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
|
@ -30,7 +26,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
|||
*/
|
||||
const gBrowserPrompts = new WeakMap();
|
||||
|
||||
class PromptParent extends JSWindowActorParent {
|
||||
export class PromptParent extends JSWindowActorParent {
|
||||
didDestroy() {
|
||||
// In the event that the subframe or tab crashed, make sure that
|
||||
// we close any active Prompts.
|
|
@ -3,11 +3,7 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["VCardChild"];
|
||||
|
||||
class VCardChild extends JSWindowActorChild {
|
||||
export class VCardChild extends JSWindowActorChild {
|
||||
handleEvent(event) {
|
||||
// This link comes from VCardMimeConverter.convertToHTML in VCardUtils.jsm.
|
||||
if (event.target.classList.contains("moz-vcard-badge")) {
|
|
@ -3,11 +3,7 @@
|
|||
* 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";
|
||||
|
||||
const EXPORTED_SYMBOLS = ["VCardParent"];
|
||||
|
||||
class VCardParent extends JSWindowActorParent {
|
||||
export class VCardParent extends JSWindowActorParent {
|
||||
receiveMessage({ data, target }) {
|
||||
target.browsingContext.topChromeWindow.toAddressBook([
|
||||
"cmd_newCard",
|
|
@ -13,12 +13,12 @@ FINAL_TARGET_FILES.actors += [
|
|||
"ChatActionChild.sys.mjs",
|
||||
"ChatActionParent.sys.mjs",
|
||||
"ContextMenuParent.sys.mjs",
|
||||
"LinkClickHandlerChild.jsm",
|
||||
"LinkClickHandlerParent.jsm",
|
||||
"LinkClickHandlerChild.sys.mjs",
|
||||
"LinkClickHandlerParent.sys.mjs",
|
||||
"LinkHandlerParent.sys.mjs",
|
||||
"MailLinkChild.jsm",
|
||||
"MailLinkParent.jsm",
|
||||
"PromptParent.jsm",
|
||||
"VCardChild.jsm",
|
||||
"VCardParent.jsm",
|
||||
"MailLinkChild.sys.mjs",
|
||||
"MailLinkParent.sys.mjs",
|
||||
"PromptParent.sys.mjs",
|
||||
"VCardChild.sys.mjs",
|
||||
"VCardParent.sys.mjs",
|
||||
]
|
||||
|
|
|
@ -147,10 +147,10 @@ const JSWINDOWACTORS = {
|
|||
|
||||
LinkClickHandler: {
|
||||
parent: {
|
||||
moduleURI: "resource:///actors/LinkClickHandlerParent.jsm",
|
||||
esModuleURI: "resource:///actors/LinkClickHandlerParent.sys.mjs",
|
||||
},
|
||||
child: {
|
||||
moduleURI: "resource:///actors/LinkClickHandlerChild.jsm",
|
||||
esModuleURI: "resource:///actors/LinkClickHandlerChild.sys.mjs",
|
||||
events: {
|
||||
click: {},
|
||||
},
|
||||
|
@ -207,10 +207,10 @@ const JSWINDOWACTORS = {
|
|||
|
||||
MailLink: {
|
||||
parent: {
|
||||
moduleURI: "resource:///actors/MailLinkParent.jsm",
|
||||
esModuleURI: "resource:///actors/MailLinkParent.sys.mjs",
|
||||
},
|
||||
child: {
|
||||
moduleURI: "resource:///actors/MailLinkChild.jsm",
|
||||
esModuleURI: "resource:///actors/MailLinkChild.sys.mjs",
|
||||
events: {
|
||||
click: {},
|
||||
},
|
||||
|
@ -231,7 +231,7 @@ const JSWINDOWACTORS = {
|
|||
|
||||
Prompt: {
|
||||
parent: {
|
||||
moduleURI: "resource:///actors/PromptParent.jsm",
|
||||
esModuleURI: "resource:///actors/PromptParent.sys.mjs",
|
||||
},
|
||||
includeChrome: true,
|
||||
allFrames: true,
|
||||
|
@ -239,10 +239,10 @@ const JSWINDOWACTORS = {
|
|||
|
||||
StrictLinkClickHandler: {
|
||||
parent: {
|
||||
moduleURI: "resource:///actors/LinkClickHandlerParent.jsm",
|
||||
esModuleURI: "resource:///actors/LinkClickHandlerParent.sys.mjs",
|
||||
},
|
||||
child: {
|
||||
moduleURI: "resource:///actors/LinkClickHandlerChild.jsm",
|
||||
esModuleURI: "resource:///actors/LinkClickHandlerChild.sys.mjs",
|
||||
events: {
|
||||
click: {},
|
||||
},
|
||||
|
@ -253,10 +253,10 @@ const JSWINDOWACTORS = {
|
|||
|
||||
VCard: {
|
||||
parent: {
|
||||
moduleURI: "resource:///actors/VCardParent.jsm",
|
||||
esModuleURI: "resource:///actors/VCardParent.sys.mjs",
|
||||
},
|
||||
child: {
|
||||
moduleURI: "resource:///actors/VCardChild.jsm",
|
||||
esModuleURI: "resource:///actors/VCardChild.sys.mjs",
|
||||
events: {
|
||||
click: {},
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче