зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1046761 - e10s context menu should handle preventDefault (r=felipe)
This commit is contained in:
Родитель
ff1f803447
Коммит
0b46442514
|
@ -80,7 +80,23 @@ addEventListener("blur", function(event) {
|
|||
|
||||
if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
|
||||
addEventListener("contextmenu", function (event) {
|
||||
sendSyncMessage("contextmenu", {}, { event: event });
|
||||
let defaultPrevented = event.defaultPrevented;
|
||||
if (!Services.prefs.getBoolPref("dom.event.contextmenu.enabled")) {
|
||||
let plugin = null;
|
||||
try {
|
||||
plugin = event.target.QueryInterface(Ci.nsIObjectLoadingContent);
|
||||
} catch (e) {}
|
||||
if (plugin && plugin.displayedType == Ci.nsIObjectLoadingContent.TYPE_PLUGIN) {
|
||||
// Don't open a context menu for plugins.
|
||||
return;
|
||||
}
|
||||
|
||||
defaultPrevented = false;
|
||||
}
|
||||
|
||||
if (!defaultPrevented) {
|
||||
sendSyncMessage("contextmenu", {}, { event: event });
|
||||
}
|
||||
}, false);
|
||||
} else {
|
||||
addEventListener("mozUITour", function(event) {
|
||||
|
@ -616,4 +632,4 @@ let DOMFullscreenHandler = {
|
|||
}
|
||||
}
|
||||
};
|
||||
DOMFullscreenHandler.init();
|
||||
DOMFullscreenHandler.init();
|
||||
|
|
Загрузка…
Ссылка в новой задаче