Source code

Revision control

Other Tools

1
/* vim: set ts=2 sw=2 sts=2 et tw=80: */
2
/* This Source Code Form is subject to the terms of the Mozilla Public
3
* License, v. 2.0. If a copy of the MPL was not distributed with this
4
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
"use strict";
6
7
var EXPORTED_SYMBOLS = ["ContextMenuSpecialProcessChild"];
8
9
const { ActorChild } = ChromeUtils.import(
11
);
12
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
13
const { E10SUtils } = ChromeUtils.import(
15
);
16
17
/**
18
* This module is a workaround for bug 1555154, where the contextmenu event doesn't
19
* cause the JS Window Actor Child to be constructed automatically in the parent
20
* process or extension process documents.
21
*/
22
class ContextMenuSpecialProcessChild extends ActorChild {
23
handleEvent(event) {
24
if (
25
Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_DEFAULT ||
26
Services.appinfo.remoteType == E10SUtils.EXTENSION_REMOTE_TYPE
27
) {
28
this.content
29
.getWindowGlobalChild()
30
.getActor("ContextMenu")
31
.handleEvent(event);
32
}
33
}
34
}