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
|
* 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";
|
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||||
|
|
||||||
const EXPORTED_SYMBOLS = [
|
|
||||||
"LinkClickHandlerChild",
|
|
||||||
"StrictLinkClickHandlerChild",
|
|
||||||
];
|
|
||||||
|
|
||||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
|
||||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
|
||||||
);
|
|
||||||
|
|
||||||
const lazy = {};
|
const lazy = {};
|
||||||
|
|
||||||
|
@ -74,7 +65,7 @@ function hRefForClickEvent(aEvent) {
|
||||||
*
|
*
|
||||||
* This actor applies to browsers in the "single-site" message manager group.
|
* This actor applies to browsers in the "single-site" message manager group.
|
||||||
*/
|
*/
|
||||||
class LinkClickHandlerChild extends JSWindowActorChild {
|
export class LinkClickHandlerChild extends JSWindowActorChild {
|
||||||
handleEvent(event) {
|
handleEvent(event) {
|
||||||
// Don't handle events that:
|
// Don't handle events that:
|
||||||
// a) are in the parent process (handled by onclick),
|
// 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.
|
* This actor applies to browsers in the "single-page" message manager group.
|
||||||
*/
|
*/
|
||||||
class StrictLinkClickHandlerChild extends JSWindowActorChild {
|
export class StrictLinkClickHandlerChild extends JSWindowActorChild {
|
||||||
handleEvent(event) {
|
handleEvent(event) {
|
||||||
// Don't handle events that:
|
// Don't handle events that:
|
||||||
// a) are in the parent process (handled by onclick),
|
// 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
|
* 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";
|
|
||||||
|
|
||||||
const EXPORTED_SYMBOLS = ["MailLinkChild"];
|
|
||||||
|
|
||||||
const PROTOCOLS = ["mailto:", "mid:", "news:", "snews:"];
|
const PROTOCOLS = ["mailto:", "mid:", "news:", "snews:"];
|
||||||
|
|
||||||
class MailLinkChild extends JSWindowActorChild {
|
export class MailLinkChild extends JSWindowActorChild {
|
||||||
handleEvent(event) {
|
handleEvent(event) {
|
||||||
const href = event.target.href;
|
const href = event.target.href;
|
||||||
const location = this.document.location;
|
const location = this.document.location;
|
|
@ -3,13 +3,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/. */
|
||||||
|
|
||||||
"use strict";
|
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||||
|
|
||||||
const EXPORTED_SYMBOLS = ["MailLinkParent"];
|
|
||||||
|
|
||||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
|
||||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
|
||||||
);
|
|
||||||
|
|
||||||
const lazy = {};
|
const lazy = {};
|
||||||
|
|
||||||
|
@ -22,7 +16,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||||
MailUtils: "resource:///modules/MailUtils.jsm",
|
MailUtils: "resource:///modules/MailUtils.jsm",
|
||||||
});
|
});
|
||||||
|
|
||||||
class MailLinkParent extends JSWindowActorParent {
|
export class MailLinkParent extends JSWindowActorParent {
|
||||||
receiveMessage(value) {
|
receiveMessage(value) {
|
||||||
switch (value.name) {
|
switch (value.name) {
|
||||||
case "imap:":
|
case "imap:":
|
|
@ -3,10 +3,6 @@
|
||||||
* 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";
|
|
||||||
|
|
||||||
var EXPORTED_SYMBOLS = ["PromptParent"];
|
|
||||||
|
|
||||||
const lazy = {};
|
const lazy = {};
|
||||||
|
|
||||||
ChromeUtils.defineESModuleGetters(lazy, {
|
ChromeUtils.defineESModuleGetters(lazy, {
|
||||||
|
@ -30,7 +26,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
||||||
*/
|
*/
|
||||||
const gBrowserPrompts = new WeakMap();
|
const gBrowserPrompts = new WeakMap();
|
||||||
|
|
||||||
class PromptParent extends JSWindowActorParent {
|
export class PromptParent extends JSWindowActorParent {
|
||||||
didDestroy() {
|
didDestroy() {
|
||||||
// In the event that the subframe or tab crashed, make sure that
|
// In the event that the subframe or tab crashed, make sure that
|
||||||
// we close any active Prompts.
|
// we close any active Prompts.
|
|
@ -3,11 +3,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/. */
|
||||||
|
|
||||||
"use strict";
|
export class VCardChild extends JSWindowActorChild {
|
||||||
|
|
||||||
const EXPORTED_SYMBOLS = ["VCardChild"];
|
|
||||||
|
|
||||||
class VCardChild extends JSWindowActorChild {
|
|
||||||
handleEvent(event) {
|
handleEvent(event) {
|
||||||
// This link comes from VCardMimeConverter.convertToHTML in VCardUtils.jsm.
|
// This link comes from VCardMimeConverter.convertToHTML in VCardUtils.jsm.
|
||||||
if (event.target.classList.contains("moz-vcard-badge")) {
|
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
|
* 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";
|
export class VCardParent extends JSWindowActorParent {
|
||||||
|
|
||||||
const EXPORTED_SYMBOLS = ["VCardParent"];
|
|
||||||
|
|
||||||
class VCardParent extends JSWindowActorParent {
|
|
||||||
receiveMessage({ data, target }) {
|
receiveMessage({ data, target }) {
|
||||||
target.browsingContext.topChromeWindow.toAddressBook([
|
target.browsingContext.topChromeWindow.toAddressBook([
|
||||||
"cmd_newCard",
|
"cmd_newCard",
|
|
@ -13,12 +13,12 @@ FINAL_TARGET_FILES.actors += [
|
||||||
"ChatActionChild.sys.mjs",
|
"ChatActionChild.sys.mjs",
|
||||||
"ChatActionParent.sys.mjs",
|
"ChatActionParent.sys.mjs",
|
||||||
"ContextMenuParent.sys.mjs",
|
"ContextMenuParent.sys.mjs",
|
||||||
"LinkClickHandlerChild.jsm",
|
"LinkClickHandlerChild.sys.mjs",
|
||||||
"LinkClickHandlerParent.jsm",
|
"LinkClickHandlerParent.sys.mjs",
|
||||||
"LinkHandlerParent.sys.mjs",
|
"LinkHandlerParent.sys.mjs",
|
||||||
"MailLinkChild.jsm",
|
"MailLinkChild.sys.mjs",
|
||||||
"MailLinkParent.jsm",
|
"MailLinkParent.sys.mjs",
|
||||||
"PromptParent.jsm",
|
"PromptParent.sys.mjs",
|
||||||
"VCardChild.jsm",
|
"VCardChild.sys.mjs",
|
||||||
"VCardParent.jsm",
|
"VCardParent.sys.mjs",
|
||||||
]
|
]
|
||||||
|
|
|
@ -147,10 +147,10 @@ const JSWINDOWACTORS = {
|
||||||
|
|
||||||
LinkClickHandler: {
|
LinkClickHandler: {
|
||||||
parent: {
|
parent: {
|
||||||
moduleURI: "resource:///actors/LinkClickHandlerParent.jsm",
|
esModuleURI: "resource:///actors/LinkClickHandlerParent.sys.mjs",
|
||||||
},
|
},
|
||||||
child: {
|
child: {
|
||||||
moduleURI: "resource:///actors/LinkClickHandlerChild.jsm",
|
esModuleURI: "resource:///actors/LinkClickHandlerChild.sys.mjs",
|
||||||
events: {
|
events: {
|
||||||
click: {},
|
click: {},
|
||||||
},
|
},
|
||||||
|
@ -207,10 +207,10 @@ const JSWINDOWACTORS = {
|
||||||
|
|
||||||
MailLink: {
|
MailLink: {
|
||||||
parent: {
|
parent: {
|
||||||
moduleURI: "resource:///actors/MailLinkParent.jsm",
|
esModuleURI: "resource:///actors/MailLinkParent.sys.mjs",
|
||||||
},
|
},
|
||||||
child: {
|
child: {
|
||||||
moduleURI: "resource:///actors/MailLinkChild.jsm",
|
esModuleURI: "resource:///actors/MailLinkChild.sys.mjs",
|
||||||
events: {
|
events: {
|
||||||
click: {},
|
click: {},
|
||||||
},
|
},
|
||||||
|
@ -231,7 +231,7 @@ const JSWINDOWACTORS = {
|
||||||
|
|
||||||
Prompt: {
|
Prompt: {
|
||||||
parent: {
|
parent: {
|
||||||
moduleURI: "resource:///actors/PromptParent.jsm",
|
esModuleURI: "resource:///actors/PromptParent.sys.mjs",
|
||||||
},
|
},
|
||||||
includeChrome: true,
|
includeChrome: true,
|
||||||
allFrames: true,
|
allFrames: true,
|
||||||
|
@ -239,10 +239,10 @@ const JSWINDOWACTORS = {
|
||||||
|
|
||||||
StrictLinkClickHandler: {
|
StrictLinkClickHandler: {
|
||||||
parent: {
|
parent: {
|
||||||
moduleURI: "resource:///actors/LinkClickHandlerParent.jsm",
|
esModuleURI: "resource:///actors/LinkClickHandlerParent.sys.mjs",
|
||||||
},
|
},
|
||||||
child: {
|
child: {
|
||||||
moduleURI: "resource:///actors/LinkClickHandlerChild.jsm",
|
esModuleURI: "resource:///actors/LinkClickHandlerChild.sys.mjs",
|
||||||
events: {
|
events: {
|
||||||
click: {},
|
click: {},
|
||||||
},
|
},
|
||||||
|
@ -253,10 +253,10 @@ const JSWINDOWACTORS = {
|
||||||
|
|
||||||
VCard: {
|
VCard: {
|
||||||
parent: {
|
parent: {
|
||||||
moduleURI: "resource:///actors/VCardParent.jsm",
|
esModuleURI: "resource:///actors/VCardParent.sys.mjs",
|
||||||
},
|
},
|
||||||
child: {
|
child: {
|
||||||
moduleURI: "resource:///actors/VCardChild.jsm",
|
esModuleURI: "resource:///actors/VCardChild.sys.mjs",
|
||||||
events: {
|
events: {
|
||||||
click: {},
|
click: {},
|
||||||
},
|
},
|
||||||
|
|
Загрузка…
Ссылка в новой задаче