Commit ab9f21b0 authored by ma1's avatar ma1 Committed by Pier Angelo Vendrame
Browse files

BB 42832: Download spam prevention exemption for browser extensions.

parent d30dd450
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1921,6 +1921,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;