From 486dad8c5e57fd8dffc3b99cd9cef1b3f119c2de Mon Sep 17 00:00:00 2001 From: Neil Deakin Date: Mon, 20 Oct 2014 09:55:36 -0400 Subject: [PATCH] Bug 1069966, use a system event listener for contextmenu events, otherwise stopPropagation can prevent the default behaviour, r=mconley --- browser/base/content/content.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/browser/base/content/content.js b/browser/base/content/content.js index 350210cec317..de0a89dba55a 100644 --- a/browser/base/content/content.js +++ b/browser/base/content/content.js @@ -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"))