summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2020-06-26 12:38:14 +0200
committerUrbain Vaes <urbain@vaes.uk>2020-06-26 12:38:14 +0200
commit1b0a177be70c9a8bdef2affc4c318c9afdcab9d3 (patch)
treebe47efce08dfdb233a91a3fbe78cc615e4d958b3
parent69b98e98e6de52a326de52ba8f20a1f0e0032b85 (diff)
[qutebrowser] Block youtube adds
-rw-r--r--qutebrowser/.config/qutebrowser/config.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/qutebrowser/.config/qutebrowser/config.py b/qutebrowser/.config/qutebrowser/config.py
index aa447b9..f1b72c7 100644
--- a/qutebrowser/.config/qutebrowser/config.py
+++ b/qutebrowser/.config/qutebrowser/config.py
@@ -2,6 +2,19 @@
# qute://help/configuring.html
# qute://help/settings.html
+from qutebrowser.api import interceptor
+
+
+def filter_yt(info: interceptor.Request):
+ url = info.request_url
+ if (url.host() == 'www.youtube.com'
+ and url.path() == '/get_video_info'
+ and '&adformat=' in url.query()):
+ info.block()
+
+
+interceptor.register(filter_yt)
+
c.content.images = True
c.downloads.location.prompt = False
c.editor.command = ['urxvt', '-e', 'nvim', '-f', '{}']