Commit 02792a42 authored by Gijs Kruitbosch's avatar Gijs Kruitbosch
Browse files

Bug 1592600 - fix prefs link in about:addons to ignore hashes/fragments as...

Bug 1592600 - fix prefs link in about:addons to ignore hashes/fragments as well as right clicks, r=mstriemer

Differential Revision: https://phabricator.services.mozilla.com/D51286

--HG--
extra : moz-landing-system : lando
parent 4dcdbaae
...@@ -118,7 +118,11 @@ function init_all() { ...@@ -118,7 +118,11 @@ function init_all() {
"preferences"; "preferences";
helpButton.setAttribute("href", helpUrl); helpButton.setAttribute("href", helpUrl);
document.getElementById("addonsButton").addEventListener("click", () => { document.getElementById("addonsButton").addEventListener("click", e => {
if (e.button >= 2) {
// Ignore right clicks.
return;
}
let mainWindow = window.docShell.rootTreeItem.domWindow; let mainWindow = window.docShell.rootTreeItem.domWindow;
mainWindow.BrowserOpenAddonsMgr(); mainWindow.BrowserOpenAddonsMgr();
AMTelemetry.recordLinkEvent({ AMTelemetry.recordLinkEvent({
......
...@@ -142,11 +142,15 @@ function initialize(event) { ...@@ -142,11 +142,15 @@ function initialize(event) {
helpButton.setAttribute("href", helpUrl); helpButton.setAttribute("href", helpUrl);
helpButton.addEventListener("click", () => recordLinkTelemetry("support")); helpButton.addEventListener("click", () => recordLinkTelemetry("support"));
document.getElementById("preferencesButton").addEventListener("click", () => { document.getElementById("preferencesButton").addEventListener("click", e => {
if (e.button >= 2) {
return;
}
let mainWindow = window.windowRoot.ownerGlobal; let mainWindow = window.windowRoot.ownerGlobal;
recordLinkTelemetry("about:preferences"); recordLinkTelemetry("about:preferences");
if ("switchToTabHavingURI" in mainWindow) { if ("switchToTabHavingURI" in mainWindow) {
mainWindow.switchToTabHavingURI("about:preferences", true, { mainWindow.switchToTabHavingURI("about:preferences", true, {
ignoreFragment: "whenComparing",
triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(), triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
}); });
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment