diff options
author | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2021-03-16 06:09:15 +0300 |
---|---|---|
committer | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2021-03-16 06:09:15 +0300 |
commit | a124b1f7b14f632421aa2a6db1d109b04d20da75 (patch) | |
tree | 652604f568e33f314fd3ff1ff3441bc140ace18e /dotfiles | |
parent | 0c0d2a1c16f66a4ec8a78d545964fb8cb6490ab3 (diff) | |
download | swayrice-a124b1f7b14f632421aa2a6db1d109b04d20da75.tar.gz swayrice-a124b1f7b14f632421aa2a6db1d109b04d20da75.zip |
qutebrowser config
Updated config and moved js whitelist to external file.
Diffstat (limited to 'dotfiles')
-rw-r--r-- | dotfiles/.config/qutebrowser/config.py | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/dotfiles/.config/qutebrowser/config.py b/dotfiles/.config/qutebrowser/config.py index 461a637..121b05d 100644 --- a/dotfiles/.config/qutebrowser/config.py +++ b/dotfiles/.config/qutebrowser/config.py @@ -1,3 +1,4 @@ +import os import subprocess # Still load settings configured via autoconfig.yml @@ -32,28 +33,12 @@ c.content.notifications = False ## Disable JS by default c.content.javascript.enabled = False -# Enable JS for certain sites -js_whitelist = [ - "*://localhost/*", - "*://127.0.0.1/*", - "*://github.com/*", - "*://duckduckgo.com/*", - "*://*.youtube.com/*", - "*://*.google.com/*", - '*://*.namecheap.com/*', - '*://*.wikipedia.org/*', - '*://yandex.ru/*', - '*://*.yaroslavps.com/*', - '*://*.openedu.ru/*', - '*://developer.mozilla.org/*', - '*://*.vultr.com/*', - '*://*.ifmo.ru/*', - '*://*.4chan.org/*', - '*://*.4channel.org/*', -] -for site in js_whitelist: - with config.pattern(site) as p: - p.content.javascript.enabled = True +# Read separate whitelist file and enable JS for those sites +with open(os.path.expanduser("~/.config/qutebrowser/jswhitelist")) as f: + for line in f: + site = line.rstrip('\n') + with config.pattern(site) as p: + p.content.javascript.enabled = True ## Disable 3rd party cookies c.content.cookies.accept = "no-3rdparty" @@ -91,7 +76,7 @@ c.url.start_pages = "https://srx.yaroslavps.com" c.fonts.default_size = "10pt" ## Prefer dark mode in websites that support it -c.colors.webpage.prefers_color_scheme_dark = True +c.colors.webpage.preferred_color_scheme = "dark" ## Background color of the completion widget category headers. ## Type: QssColor |