Bug 1696286 - Disable main action highlight in PermissionUI panels when Proton is enabled. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D107128
This commit is contained in:
Mike Conley 2021-03-08 17:45:21 +00:00
Родитель a977bf134b
Коммит 5a66c4b4a4
1 изменённых файлов: 14 добавлений и 0 удалений

Просмотреть файл

@ -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