tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit b00bde2b14b5e6565e8f8c85e994c3e91eef05cf
parent a038c8d2a8355610aa4de7daf2af98d77a4fecd2
Author: Andrea Marchesini <amarchesini@mozilla.com>
Date:   Fri,  9 Jan 2026 16:09:12 +0000

Bug 2007379 - IPProtection: do not show warning messages on excluded websites, r=ip-protection-reviewers,rking

Differential Revision: https://phabricator.services.mozilla.com/D277855

Diffstat:
Mbrowser/extensions/ipp-activator/extension/api/parent/ext-ipp.js | 21+++++++++++++++++++++
Mbrowser/extensions/ipp-activator/extension/api/schemas/ipp.json | 13+++++++++++++
Mbrowser/extensions/ipp-activator/extension/bg.js | 4++++
3 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/browser/extensions/ipp-activator/extension/api/parent/ext-ipp.js b/browser/extensions/ipp-activator/extension/api/parent/ext-ipp.js @@ -7,6 +7,8 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { ExtensionParent: "resource://gre/modules/ExtensionParent.sys.mjs", + IPPExceptionsManager: + "moz-src:///browser/components/ipprotection/IPPExceptionsManager.sys.mjs", IPPProxyManager: "moz-src:///browser/components/ipprotection/IPPProxyManager.sys.mjs", IPPProxyStates: @@ -164,6 +166,25 @@ this.ippActivator = class extends ExtensionAPI { return { baseDomain: "", host: "" }; } }, + hasExclusion(url) { + if ( + !Services.prefs.getBoolPref( + "browser.ipProtection.features.siteExceptions", + false + ) + ) { + return false; + } + + try { + const uri = Services.io.newURI(url); + const principal = + Services.scriptSecurityManager.createContentPrincipal(uri, {}); + return lazy.IPPExceptionsManager.hasExclusion(principal); + } catch (e) { + return false; + } + }, async showMessage(message, tabId) { try { // Choose the target tab (by id if provided, else active tab) diff --git a/browser/extensions/ipp-activator/extension/api/schemas/ipp.json b/browser/extensions/ipp-activator/extension/api/schemas/ipp.json @@ -106,6 +106,19 @@ "description": "The URL to analyze." } ] + }, + { + "name": "hasExclusion", + "type": "function", + "description": "Return true if this URL has ipp-vpn permission set to DENY.", + "async": true, + "parameters": [ + { + "name": "url", + "type": "string", + "description": "The URL to analyze." + } + ] } ], "events": [ diff --git a/browser/extensions/ipp-activator/extension/bg.js b/browser/extensions/ipp-activator/extension/bg.js @@ -290,6 +290,10 @@ class IPPAddonActivator { return false; } + if (await browser.ippActivator.hasExclusion(url)) { + return false; + } + let domain = info.baseDomain; let breakage = breakages.find( b => Array.isArray(b.domains) && b.domains.includes(info.baseDomain)