Bug 1069966 - Use a system event listener for contextmenu events, otherwise stopPropagation can prevent the default behaviour. r=mconley

This commit is contained in:
Neil Deakin 2014-10-20 09:55:36 -04:00
parent 011a403f9c
commit 47dd67978d

View File

@ -86,7 +86,7 @@ addEventListener("blur", function(event) {
});
if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
addEventListener("contextmenu", function (event) {
let handleContentContextMenu = function (event) {
let defaultPrevented = event.defaultPrevented;
if (!Services.prefs.getBoolPref("dom.event.contextmenu.enabled")) {
let plugin = null;
@ -112,7 +112,12 @@ if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
sendSyncMessage("contextmenu", { editFlags, spellInfo }, { event });
}
}, false);
}
Cc["@mozilla.org/eventlistenerservice;1"]
.getService(Ci.nsIEventListenerService)
.addSystemEventListener(global, "contextmenu", handleContentContextMenu, true);
} else {
addEventListener("mozUITour", function(event) {
if (!Services.prefs.getBoolPref("browser.uitour.enabled"))