Bug 1274533 - change legacy behaviour in observer rather than overwriting key status in data, r=jaws

MozReview-Commit-ID: UZWRYj2Mno

--HG--
extra : rebase_source : d4042eea112cf2fd75995734305833acd3bdfbea
extra : amend_source : 8825de2c1a8e5b88ddf7dd291687ee9e72a6c904
This commit is contained in:
Gijs Kruitbosch 2016-05-20 11:51:20 +01:00
parent 29525495be
commit a2cc4253f0
2 changed files with 5 additions and 11 deletions

View File

@ -380,6 +380,11 @@ BrowserGlue.prototype = {
if (win) {
data = JSON.parse(data);
let where = win.whereToOpenLink(data);
// Preserve legacy behavior of non-modifier left-clicks
// opening in a new selected tab.
if (where == "current") {
where = "tab";
}
win.openUILinkIn(data.href, where);
linkHandled.data = true;
}

View File

@ -357,17 +357,6 @@
.createInstance(Components.interfaces.nsISupportsPRBool);
linkHandled.data = false;
let {shiftKey, ctrlKey, metaKey, altKey, button} = aEvent;
if (!shiftKey && !altKey) {
// Preserve legacy behavior of non-modifier left-clicks
// opening in a new selected tab.
let {AppConstants} =
Components.utils.import("resource://gre/modules/AppConstants.jsm", {});
if (AppConstants.platform == "macosx") {
metaKey = true;
} else {
ctrlKey = true;
}
}
let data = {shiftKey, ctrlKey, metaKey, altKey, button, href};
Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService)