Fix: match subdomain

This commit is contained in:
eight 2018-10-11 23:54:58 +08:00
parent a57b3b2716
commit 99626e4a48

View File

@ -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))) {