mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-28 20:55:39 +00:00
Bug 439292: allow 'open in new tab/window' for mailto links if the registered handler is a web handler, patch by Natch <highmind63@gmail.com>, r=me
This commit is contained in:
parent
69c0f2c2b4
commit
43ad651252
@ -131,7 +131,16 @@ nsContextMenu.prototype = {
|
||||
},
|
||||
|
||||
initOpenItems: function CM_initOpenItems() {
|
||||
var shouldShow = this.onSaveableLink ||
|
||||
var isMailtoInternal = false;
|
||||
if (this.onMailtoLink) {
|
||||
var mailtoHandler = Cc["@mozilla.org/uriloader/external-protocol-service;1"].
|
||||
getService(Ci.nsIExternalProtocolService).
|
||||
getProtocolHandlerInfo("mailto");
|
||||
isMailtoInternal = (!mailtoHandler.alwaysAskBeforeHandling &&
|
||||
mailtoHandler.preferredAction == Ci.nsIHandlerInfo.useHelperApp &&
|
||||
(mailtoHandler.preferredApplicationHandler instanceof Ci.nsIWebHandlerApp));
|
||||
}
|
||||
var shouldShow = this.onSaveableLink || isMailtoInternal ||
|
||||
(this.inDirList && this.onLink);
|
||||
this.showItem("context-openlink", shouldShow);
|
||||
this.showItem("context-openlinkintab", shouldShow);
|
||||
|
Loading…
Reference in New Issue
Block a user