Backed out 2 changesets (bug 1836448) for bc failure on browser_preferences_usage.js

Backed out changeset 1c53eee1c466 (bug 1836448)
Backed out changeset a86d5a3f177d (bug 1836448)
This commit is contained in:
Narcis Beleuzu
2023-06-08 21:22:20 +03:00
parent c6ad3b156d
commit 8f2b59f94b
7 changed files with 45 additions and 195 deletions

View File

@@ -1222,27 +1222,19 @@ var gUnifiedExtensions = {
// Only show for extensions which are not already visible in the toolbar.
if (!widget || widget.areaType !== CustomizableUI.TYPE_TOOLBAR) {
if (lazy.OriginControls.getAttentionState(policy, window).attention) {
if (lazy.OriginControls.getAttention(policy, window)) {
attention = true;
break;
}
}
}
// If the domain is quarantined and we have extensions not allowed, we'll
// show a notification in the panel so we want to let the user know about
// it.
const quarantined = this._shouldShowQuarantinedNotification();
this.button.toggleAttribute("attention", quarantined || attention);
let msgId = attention
? "unified-extensions-button-permissions-needed"
: "unified-extensions-button";
// Quarantined state takes precedence over anything else.
if (quarantined) {
msgId = "unified-extensions-button-quarantined";
}
this.button.ownerDocument.l10n.setAttributes(this.button, msgId);
this.button.toggleAttribute("attention", attention);
this.button.ownerDocument.l10n.setAttributes(
this.button,
attention
? "unified-extensions-button-permissions-needed"
: "unified-extensions-button"
);
},
getPopupAnchorID(aBrowser, aWindow) {
@@ -1352,13 +1344,16 @@ var gUnifiedExtensions = {
list.appendChild(item);
}
const isQuarantinedDomain = this.getActivePolicies().some(
policy =>
lazy.OriginControls.getState(policy, window.gBrowser.selectedTab)
.quarantined
);
const container = panelview.querySelector(
"#unified-extensions-messages-container"
);
const shouldShowQuarantinedNotification =
this._shouldShowQuarantinedNotification();
if (shouldShowQuarantinedNotification) {
if (isQuarantinedDomain) {
if (!this._messageBarQuarantinedDomain) {
this._messageBarQuarantinedDomain = this._makeMessageBar({
titleFluentId: "unified-extensions-mb-quarantined-domain-title",
@@ -1375,7 +1370,7 @@ var gUnifiedExtensions = {
container.appendChild(this._messageBarQuarantinedDomain);
} else if (
!shouldShowQuarantinedNotification &&
!isQuarantinedDomain &&
this._messageBarQuarantinedDomain &&
container.contains(this._messageBarQuarantinedDomain)
) {
@@ -1911,19 +1906,4 @@ var gUnifiedExtensions = {
return messageBar;
},
_shouldShowQuarantinedNotification() {
const { currentURI, selectedTab } = window.gBrowser;
// We should show the quarantined notification when the domain is in the
// list of quarantined domains and we have at least one extension
// quarantined. In addition, we check that we have extensions in the panel
// until Bug 1778684 is resolved.
return (
WebExtensionPolicy.isQuarantinedURI(currentURI) &&
this.hasExtensionsInPanel() &&
this.getActivePolicies().some(
policy => lazy.OriginControls.getState(policy, selectedTab).quarantined
)
);
},
};