X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/d61d5bfe37a92f82b682562144627b9f625ee502..07f517faf8d0cbd8c12e35de06eac06f2348f44a:/qutebrowser/config.py diff --git a/qutebrowser/config.py b/qutebrowser/config.py index 746c785..097a061 100644 --- a/qutebrowser/config.py +++ b/qutebrowser/config.py @@ -7,6 +7,29 @@ ## Remove it to not load settings done via the GUI. config.load_autoconfig() +try: + from qutebrowser.api import interceptor, message + from PyQt5.QtCore import QUrl + + def intercept(info: interceptor.Request): + url = info.request_url + if url.host() == "twitter.com": + url.setHost("nitter.net") + message.info("Redirecting to " + url.toString()) + info.redirect(url) + if url.host() == "xkcd.com": + url.setHost("m.xkcd.com") + message.info("Redirecting to " + url.toString()) + info.redirect(url) + if url.host() == "www.bristolpost.co.uk": + url.setUrl("https://outline.com/" + url.toString()) + message.info("Redirecting to " + url.toString()) + info.redirect(url) + + interceptor.register(intercept) +except ImportError: + pass + ## Aliases for commands. The keys of the given dictionary are the ## aliases, while the values are the commands they map to. ## Type: Dict @@ -619,7 +642,7 @@ c.content.dns_prefetch = True ## - true ## - false ## - ask -# c.content.geolocation = 'ask' +c.content.geolocation = False ## Value to send in the `Accept-Language` header. Note that the value ## read from JavaScript is always the global value. @@ -1844,10 +1867,10 @@ config.bind('m', 'spawn mpv {url}') # config.bind('sk', 'set-cmd-text -s :bind') # config.bind('sl', 'set-cmd-text -s :set -t') # config.bind('ss', 'set-cmd-text -s :set') -config.bind('tCH', 'spawn --userscript config-cycle-tld -p content.cookies.accept no-3rdparty never;; reload') config.bind('tCh', 'spawn --userscript config-cycle-tld -p content.cookies.accept no-3rdparty never;; reload') -config.bind('tcH', 'spawn --userscript config-cycle-tld -p -t content.cookies.accept no-3rdparty never;; reload') config.bind('tch', 'spawn --userscript config-cycle-tld -p -t content.cookies.accept no-3rdparty never;; reload') +config.bind('tGh', 'spawn --userscript config-cycle-tld -p content.geolocation ;; reload') +config.bind('tgh', 'spawn --userscript config-cycle-tld -p -t content.geolocation ;; reload') # config.bind('tIH', 'config-cycle -p -u *://*.{url:host}/* content.images ;; reload') # config.bind('tIh', 'config-cycle -p -u *://{url:host}/* content.images ;; reload') # config.bind('tIu', 'config-cycle -p -u {url} content.images ;; reload')