diff --git a/qutebrowser/browser/adblock.py b/qutebrowser/browser/adblock.py index afb7a2a18..d2a21639c 100644 --- a/qutebrowser/browser/adblock.py +++ b/qutebrowser/browser/adblock.py @@ -112,9 +112,12 @@ class HostBlocker: def is_blocked(self, url, first_party_url=None): """Check if the given URL (as QUrl) is blocked.""" + if first_party_url is not None and not first_party_url.isValid(): + first_party_url = None if not config.instance.get('content.host_blocking.enabled', url=first_party_url): return False + host = url.host() return ((host in self._blocked_hosts or host in self._config_blocked_hosts) and