Skip to content

Commit

Permalink
use isprivatedomain to check if tab is localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
ablanathtanalba committed Sep 16, 2020
1 parent 3de5834 commit ba2b685
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/js/heuristicblocking.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit ba2b685

Please sign in to comment.