From dae164abeeb3aedc9bda6bec2621140f3a6b5b4b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 15 Feb 2018 17:16:20 +0100 Subject: [PATCH] urlmatch: Get rid of scheme whitelist There are more schemes like data: or javascript:, and we don't want to restrict schemes anyways. --- qutebrowser/utils/urlmatch.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/qutebrowser/utils/urlmatch.py b/qutebrowser/utils/urlmatch.py index b42e4249d..72d026ba9 100644 --- a/qutebrowser/utils/urlmatch.py +++ b/qutebrowser/utils/urlmatch.py @@ -42,9 +42,6 @@ class UrlPattern: """A Chromium-like URL matching pattern. - Class attributes: - SCHEMES: Schemes which are allowed in patterns. - Attributes: _pattern: The given pattern as string. _match_all: Whether the pattern should match all URLs. @@ -59,8 +56,6 @@ class UrlPattern: _port: The port to match to as integer, or None for any port. """ - SCHEMES = ['https', 'http', 'ftp', 'file', 'chrome', 'qute', 'about'] - def __init__(self, pattern): # Make sure all attributes are initialized if we exit early. self._pattern = pattern @@ -116,8 +111,6 @@ class UrlPattern: elif parsed.scheme == 'any': self._scheme = None return - elif parsed.scheme not in self.SCHEMES: - raise ParseError("Unknown scheme {}".format(parsed.scheme)) self._scheme = parsed.scheme @@ -186,8 +179,6 @@ class UrlPattern: return utils.get_repr(self, pattern=self._pattern, constructor=True) def _matches_scheme(self, scheme): - if scheme not in self.SCHEMES: - return False return self._scheme is None or self._scheme == scheme def _matches_host(self, host):