summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qutebrowser/components/braveadblock.py6
-rw-r--r--tests/unit/components/test_braveadblock.py6
2 files changed, 11 insertions, 1 deletions
diff --git a/qutebrowser/components/braveadblock.py b/qutebrowser/components/braveadblock.py
index b00135660..ab8adbdae 100644
--- a/qutebrowser/components/braveadblock.py
+++ b/qutebrowser/components/braveadblock.py
@@ -141,7 +141,11 @@ class BraveAdBlocker:
# use of this adblocking module.
return False
- if first_party_url is None or not first_party_url.isValid():
+ if (
+ first_party_url is None
+ or not first_party_url.isValid()
+ or first_party_url.scheme() == "file"
+ ):
# FIXME: It seems that when `first_party_url` is None, every URL
# I try is blocked. This may have been a result of me incorrectly
# using the upstream library, or an upstream bug. For now we don't
diff --git a/tests/unit/components/test_braveadblock.py b/tests/unit/components/test_braveadblock.py
index eca8b5eb0..d85538807 100644
--- a/tests/unit/components/test_braveadblock.py
+++ b/tests/unit/components/test_braveadblock.py
@@ -91,6 +91,12 @@ NOT_OKAY_URLS = [
BUGGY_URLS = [
# https://github.com/brave/adblock-rust/issues/146
("https://example.org/example.png", None, ResourceType.image),
+ # https://github.com/qutebrowser/qutebrowser/issues/6000
+ (
+ "https://wikimedia.org/api/rest_v1/media/math/render/svg/57f8",
+ "file:///home/user/src/qutebrowser/reproc.html",
+ ResourceType.image,
+ ),
]