Skip to content

Commit 7d60f7e

Browse files
committed
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
1 parent b9f5ce6 commit 7d60f7e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

browser/components/contentanalysis/content/ContentAnalysis.sys.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ XPCOMUtils.defineLazyPreferenceGetter(
4242
"A DLP agent"
4343
);
4444

45+
XPCOMUtils.defineLazyPreferenceGetter(
46+
lazy,
47+
"showBlockedResult",
48+
"browser.contentanalysis.show_blocked_result",
49+
true
50+
);
51+
4552
/**
4653
* A class that groups browsing contexts by their top-level one.
4754
* This is necessary because if there may be a subframe that
@@ -705,6 +712,10 @@ export const ContentAnalysis = {
705712
lazy.gContentAnalysis.respondToWarnDialog(aRequestToken, allow);
706713
return null;
707714
case Ci.nsIContentAnalysisResponse.eBlock:
715+
if (!lazy.showBlockedResult) {
716+
// Don't show anything
717+
return null;
718+
}
708719
message = await this.l10n.formatValue("contentanalysis-block-message", {
709720
content: this._getResourceNameFromNameOrOperationType(
710721
aResourceNameOrOperationType

0 commit comments

Comments
 (0)