]> git.rmz.io Git - dotfiles.git/blobdiff - qutebrowser/config.py
ranger: add preview for zip files
[dotfiles.git] / qutebrowser / config.py
index 621042ed0c61f33913ceff895acb463e66106b48..097a061fd10462a30578d45a2d00f7126d82c764 100644 (file)
@@ -5,7 +5,30 @@
 
 ## This is here so configs done via the GUI are still loaded.
 ## Remove it to not load settings done via the GUI.
-# config.load_autoconfig()
+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.
@@ -573,7 +596,7 @@ c.confirm_quit = ['downloads']
 ##   - no-3rdparty: Accept cookies from the same origin only. This is known to break some sites, such as GMail.
 ##   - no-unknown-3rdparty: Accept cookies from the same origin only, unless a cookie is already set for the domain. On QtWebEngine, this is the same as no-3rdparty.
 ##   - never: Don't accept cookies at all.
-c.content.cookies.accept = 'no-3rdparty'
+c.content.cookies.accept = 'never'
 
 ## Store cookies. Note this option needs a restart with QtWebEngine on Qt
 ## < 5.9.
@@ -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.
@@ -777,7 +800,9 @@ c.content.headers.accept_language = 'en-UK;q=1.0, en;q=0.9, de;q=0.7, fr;q=0.7,
 ##   - true
 ##   - false
 ##   - ask
-# c.content.notifications = 'ask'
+c.content.notifications = 'ask'
+config.set('content.notifications', True, '*://*.gitlab.com/*')
+config.set('content.notifications', True, '*://*.google.com/*')
 
 ## Allow pdf.js to view PDF files in the browser. Note that the files can
 ## still be downloaded by clicking the download button in the pdf.js
@@ -1842,6 +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 -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')
@@ -1886,6 +1915,9 @@ config.bind('m', 'spawn mpv {url}')
 # config.bind('yp', 'yank pretty-url')
 # config.bind('yt', 'yank title')
 # config.bind('yy', 'yank')
+config.bind('zl',  'spawn --userscript qute-pass')
+config.bind('zul', 'spawn --userscript qute-pass --username-only')
+config.bind('zpl', 'spawn --userscript qute-pass --password-only')
 # config.bind('{{', 'navigate prev -t')
 # config.bind('}}', 'navigate next -t')