From ba2b685d29c5ed234fdb60e063da615a71b7e4fb Mon Sep 17 00:00:00 2001 From: ablanathtanalba Date: Wed, 16 Sep 2020 13:50:59 -0700 Subject: [PATCH] use isprivatedomain to check if tab is localhost --- src/js/heuristicblocking.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/js/heuristicblocking.js b/src/js/heuristicblocking.js index 7209c166b9..f6b3416dcd 100644 --- a/src/js/heuristicblocking.js +++ b/src/js/heuristicblocking.js @@ -124,11 +124,9 @@ HeuristicBlocker.prototype = { let tab_origin = self.tabOrigins[details.tabId]; // return early if tab origin is a localhost address - ['127.0', 'localhost', 'http://localhost'].forEach((localhost) => { - if (tab_origin.startsWith(localhost)) { - return {}; - } - }); + if (window.isPrivateDomain(tab_origin)) { + return {}; + } // ignore first-party requests if (!tab_origin || !utils.isThirdPartyDomain(request_origin, tab_origin)) {