From 443d9d5f2856b9107e681a94660de3f3692ed99e Mon Sep 17 00:00:00 2001 From: Alisha Ukani Date: Tue, 15 Oct 2024 14:38:53 -0700 Subject: [PATCH] Fix how blocked requests made inside nested 'about:blank' iFrames are counted (#1019) --- .../ContentBlocking/UserScripts/contentblockerrules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/BrowserServicesKit/ContentBlocking/UserScripts/contentblockerrules.js b/Sources/BrowserServicesKit/ContentBlocking/UserScripts/contentblockerrules.js index 7ca771a6e..515ddbd2c 100644 --- a/Sources/BrowserServicesKit/ContentBlocking/UserScripts/contentblockerrules.js +++ b/Sources/BrowserServicesKit/ContentBlocking/UserScripts/contentblockerrules.js @@ -139,7 +139,7 @@ // FROM: https://stackoverflow.com/a/7739035/73479 // FIX: Better capturing of top level URL so that trackers in embedded documents are not considered first party if (window.location !== window.parent.location) { - return new URL(window.location.href !== 'about:blank' ? document.referrer : window.parent.location.href) + return new URL(window.location.href !== 'about:blank' ? document.referrer : window.parent.origin) } else { return new URL(document.location.href) }