From 5a66c4b4a41ab78a87c30c9db0d93c732c534402 Mon Sep 17 00:00:00 2001 From: Mike Conley Date: Mon, 8 Mar 2021 17:45:21 +0000 Subject: [PATCH] Bug 1696286 - Disable main action highlight in PermissionUI panels when Proton is enabled. r=Gijs Differential Revision: https://phabricator.services.mozilla.com/D107128 --- browser/modules/PermissionUI.jsm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/browser/modules/PermissionUI.jsm b/browser/modules/PermissionUI.jsm index c6bbe3bb9d63..ba721aa65314 100644 --- a/browser/modules/PermissionUI.jsm +++ b/browser/modules/PermissionUI.jsm @@ -97,6 +97,13 @@ XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", function() { ); }); +XPCOMUtils.defineLazyPreferenceGetter( + this, + "protonDoorhangersEnabled", + "browser.proton.doorhangers.enabled", + false +); + var PermissionUI = {}; /** @@ -589,6 +596,13 @@ var PermissionPromptPrototype = { options.hideClose = true; } + if ( + protonDoorhangersEnabled && + !mainAction.hasOwnProperty("disableHighlight") + ) { + mainAction.disableHighlight = true; + } + options.eventCallback = (topic, nextRemovalReason, isCancel) => { // When the docshell of the browser is aboout to be swapped to another one, // the "swapping" event is called. Returning true causes the notification