Skip to content

Commit ba2b685

Browse files
use isprivatedomain to check if tab is localhost
1 parent 3de5834 commit ba2b685

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/js/heuristicblocking.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,9 @@ HeuristicBlocker.prototype = {
124124
let tab_origin = self.tabOrigins[details.tabId];
125125

126126
// return early if tab origin is a localhost address
127-
['127.0', 'localhost', 'http://localhost'].forEach((localhost) => {
128-
if (tab_origin.startsWith(localhost)) {
129-
return {};
130-
}
131-
});
127+
if (window.isPrivateDomain(tab_origin)) {
128+
return {};
129+
}
132130

133131
// ignore first-party requests
134132
if (!tab_origin || !utils.isThirdPartyDomain(request_origin, tab_origin)) {

0 commit comments

Comments
 (0)