Skip to content

Commit

Permalink
Fix: match subdomain
Browse files Browse the repository at this point in the history
  • Loading branch information
eight04 committed Oct 11, 2018
1 parent a57b3b2 commit 99626e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion background/style-manager.js
Expand Up @@ -387,7 +387,8 @@ const styleManager = (() => {

function urlMatchSection(url, section) {
// FIXME: match sub domains?
if (section.domains && section.domains.includes(getDomain(url))) {
const domain = getDomain(url);
if (section.domains && section.domains.some(d => d === domain || domain.endsWith(`.${d}`))) {
return true;
}
if (section.urlPrefixes && section.urlPrefixes.some(p => url.startsWith(p))) {
Expand Down

0 comments on commit 99626e4

Please sign in to comment.