From 83268798a6473bed620b0514dc093dd240552043 Mon Sep 17 00:00:00 2001 From: Felipe M Date: Mon, 28 Dec 2020 18:28:46 +0100 Subject: [PATCH] Qutebrowser config --- .config/qutebrowser/config.py | 34 ++++++++++++++++++++++++++++++++++ .config/qutebrowser/quickmarks | 4 ++++ 2 files changed, 38 insertions(+) create mode 100644 .config/qutebrowser/config.py create mode 100644 .config/qutebrowser/quickmarks diff --git a/.config/qutebrowser/config.py b/.config/qutebrowser/config.py new file mode 100644 index 0000000..11f6211 --- /dev/null +++ b/.config/qutebrowser/config.py @@ -0,0 +1,34 @@ +from qutebrowser.api import interceptor + + +# Youtube Ad Blocker +# From: https://gist.github.com/Gavinok/f9c310a66576dc00329dd7bef2b122a1 + +def filter_youtube_ads(info: interceptor.Request): + """Block the given request if necessary.""" + url = info.request_url + # Video ads + if ( + url.host() == "www.youtube.com" + and url.path() == "/get_video_info" + and "&adformat=" in url.query() + ): + info.block() + + +interceptor.register(filter_youtube_ads) + +# Session save/restore +c.auto_save.session = True +c.auto_save.interval = 15000 + +# Search engines +c.url.searchengines = { + 'DEFAULT': 'https://google.com/search?hl=en&q={}', + '!a': 'https://www.amazon.es/s?k={}', + '!gh': 'https://github.com/search?o=desc&q={}&s=stars', +} + +# Default page and new tab +c.url.default_page = "https://miniflux.fmartingr.dev" +c.url.start_pages = ["https://miniflux.fmartingr.dev"] diff --git a/.config/qutebrowser/quickmarks b/.config/qutebrowser/quickmarks new file mode 100644 index 0000000..e1aa07d --- /dev/null +++ b/.config/qutebrowser/quickmarks @@ -0,0 +1,4 @@ +disc https://discord.com/channels/@me +gh https://github.com/ +yt https://www.youtube.com/ +tw https://twitter.com/