Greasemonkey: make *clude regexes case insensitive

Sometimes I don't read specs so good.
This commit is contained in:
Jimmy 2018-01-17 18:17:14 +13:00
parent b2f95339ce
commit 971b413991

View File

@ -201,7 +201,8 @@ class GreasemonkeyManager(QObject):
# should be treated as a (ecma syntax) regular expression.
string_url = url.toString(QUrl.FullyEncoded)
if pattern.startswith('/') and pattern.endswith('/'):
return re.search(pattern[1:-1], string_url) is not None
matches = re.search(pattern[1:-1], string_url, flags=re.I)
return matches is not None
# Otherwise they are glob expressions.
return fnmatch.fnmatch(string_url, pattern)