Skip to content

Commit

Permalink
Correct domain detection logic
Browse files Browse the repository at this point in the history
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
  • Loading branch information
NicholasEllul and Gudahtt authored Feb 22, 2024
1 parent 6610819 commit a1c30f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/inpage-bridge/content-script/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function blockedDomainCheck() {
const hostname = currentUrl.hostname;
const path = currentUrl.pathname;

const blockedDomainFound = blockedDomains.some(blockedDomain => hostname.endsWith(blockedDomain));
const blockedDomainFound = blockedDomains.some(blockedDomain => blockedDomain === hostname || hostname.endsWith(`.${blockedDomain}`));
const blockedHrefFound = blockedHrefs.some(blockedHref => (hostname + path).includes(blockedHref));

return blockedDomainFound || blockedHrefFound;
Expand Down

0 comments on commit a1c30f0

Please sign in to comment.