Bug 1882603 - don't show Content Analysis Block result if pref is set r=dlp-reviewers,handyman

Differential Revision: https://phabricator.services.mozilla.com/D205153
This commit is contained in:
Greg Stoll 2024-03-20 17:35:26 +00:00
parent b9f5ce64d8
commit 7d60f7e735

View file

@ -42,6 +42,13 @@ XPCOMUtils.defineLazyPreferenceGetter(
"A DLP agent"
);
XPCOMUtils.defineLazyPreferenceGetter(
lazy,
"showBlockedResult",
"browser.contentanalysis.show_blocked_result",
true
);
/**
* A class that groups browsing contexts by their top-level one.
* This is necessary because if there may be a subframe that
@ -705,6 +712,10 @@ export const ContentAnalysis = {
lazy.gContentAnalysis.respondToWarnDialog(aRequestToken, allow);
return null;
case Ci.nsIContentAnalysisResponse.eBlock:
if (!lazy.showBlockedResult) {
// Don't show anything
return null;
}
message = await this.l10n.formatValue("contentanalysis-block-message", {
content: this._getResourceNameFromNameOrOperationType(
aResourceNameOrOperationType