Better belongsto check when different subdomain
This commit is contained in:
@@ -32,8 +32,9 @@ class UserscriptBase(Plugin):
|
|||||||
def belongsTo(self, url):
|
def belongsTo(self, url):
|
||||||
|
|
||||||
host = urlparse(url).hostname
|
host = urlparse(url).hostname
|
||||||
if host.startswith('www.'):
|
host_split = host.split('.')
|
||||||
host = host[4:]
|
if len(host_split) > 2:
|
||||||
|
host = host[len(host_split[0]):]
|
||||||
|
|
||||||
for include in self.includes:
|
for include in self.includes:
|
||||||
if host in include:
|
if host in include:
|
||||||
|
|||||||
Reference in New Issue
Block a user