From 084d3de65b89fcf4941c8156d90ad35ea3ec0280 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 15 Feb 2018 17:25:10 +0100 Subject: [PATCH] urlmatch: Add support for data: and javascript: --- qutebrowser/utils/urlmatch.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qutebrowser/utils/urlmatch.py b/qutebrowser/utils/urlmatch.py index 72d026ba9..92a122377 100644 --- a/qutebrowser/utils/urlmatch.py +++ b/qutebrowser/utils/urlmatch.py @@ -127,7 +127,7 @@ class UrlPattern: - http://:1234/ is not a valid URL because it has no host. """ if parsed.hostname is None or not parsed.hostname.strip(): - if self._scheme not in ['about', 'file']: + if self._scheme not in ['about', 'file', 'data', 'javascript']: raise ParseError("Pattern without host") assert self._host is None return @@ -170,7 +170,8 @@ class UrlPattern: allows_ports = {'https': True, 'http': True, 'ftp': True, 'file': False, 'chrome': False, 'qute': False, - 'about': False, None: True} + 'about': False, 'data': False, 'javascript': False, + None: True} if not allows_ports[self._scheme] and self._port is not None: raise ParseError("Ports are unsupported with {} scheme".format( self._scheme))