tor-browser

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

commit fb83fbd6982a5c535cff012f8dc8158a12f2e4e5
parent 8725e1596b6b83e1421de5e79bac538b16f40659
Author: hackademix <giorgio@maone.net>
Date:   Tue, 24 Sep 2024 23:13:21 +0200

BB 42832: Download spam prevention exemption for browser extensions.

Diffstat:
Muriloader/exthandler/nsExternalHelperAppService.cpp | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -1931,6 +1931,12 @@ bool nsExternalAppHandler::IsDownloadSpam(nsIChannel* aChannel) { nsCOMPtr<nsIPermissionManager> permissionManager = mozilla::services::GetPermissionManager(); nsCOMPtr<nsIPrincipal> principal = loadInfo->TriggeringPrincipal(); + + // Always allow WebExtensions + if (principal && principal->SchemeIs("moz-extension")) { + return false; + } + bool exactHostMatch = false; constexpr auto type = "automatic-download"_ns; nsCOMPtr<nsIPermission> permission;