From bd29839910faef3a17a2863e5db9756947ad7f7f Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 12 Aug 2024 21:26:14 +0200 Subject: [PATCH] qutebrowser: Fix visual selection errors, typehints --- qutebrowser/config/config.py | 18 +++++++++++++++--- qutebrowser/config/maps.py | 8 +++----- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/qutebrowser/config/config.py b/qutebrowser/config/config.py index 8a559a4..914ed43 100644 --- a/qutebrowser/config/config.py +++ b/qutebrowser/config/config.py @@ -1,15 +1,27 @@ import os +from typing import cast +# pylint: disable=C0111 from qutebrowser.config.config import ConfigContainer # noqa: F401 from qutebrowser.config.configfiles import ConfigAPI # noqa: F401 +config: ConfigAPI = cast(ConfigAPI, config) # noqa: F821 pylint: disable=E0602,C0103 +c: ConfigContainer = cast(ConfigContainer, c) # noqa: F821 pylint: disable=E0602,C0103 + # Autogenerated config.py # Documentation: # qute://help/configuring.html # qute://help/settings.html # load additional settings configured via autoconfig.yml -config.load_autoconfig() +_ = config.load_autoconfig() + +c.content.javascript.log_message.excludes = { + "userscript:_qute_stylesheet": [ + "*Refused to apply inline style because it violates the following Content Security Policy directive: *" + ], + "userscript:_qute_js": ["*TrustedHTML*"], +} term = os.getenv("TERMINAL", "xterm") @@ -73,8 +85,8 @@ c.hints.selectors["code"] = [ ] # give the browser nice theme colors -state_dir=os.environ.get('XDG_STATE_HOME', f"{os.environ['HOME']}/.local/state") -colorscheme=f"{state_dir}/qutebrowser/colorscheme.py" +state_dir = os.environ.get("XDG_STATE_HOME", f"{os.environ['HOME']}/.local/state") +colorscheme = f"{state_dir}/qutebrowser/colorscheme.py" if os.path.isfile(colorscheme): config.source(colorscheme) diff --git a/qutebrowser/config/maps.py b/qutebrowser/config/maps.py index 377c30f..fb4f192 100644 --- a/qutebrowser/config/maps.py +++ b/qutebrowser/config/maps.py @@ -48,11 +48,9 @@ config.bind(leader + "tV", "set tabs.position left") # [M]edia shortcuts - watch, queue, download media # bind mpv to play the current page/links, using a single instance which queues the next link passed -config.bind(lleader + "M", "spawn umpv {url}") config.bind(lleader + "m", "hint links spawn umpv {hint-url}") -config.bind(lleader + "I", "spawn uoeia -v imv {url}") config.bind(lleader + "i", "hint links spawn uoeia -v imv {hint-url}") -config.bind(lleader + "", "hint images spawn uoeia -v imv {hint-url}") +config.bind(lleader + "I", "hint images spawn uoeia -v imv {hint-url}") # for images directly # [G]emini shortcuts # the full power of qutebrowser at your fingertips for any gemini page! @@ -73,9 +71,9 @@ config.bind(lleader + "dp", "save-to-pdf", mode="normal") config.bind("gD", "recent-downloads", mode="normal") config.bind('"w', "add-wallabag", mode="normal") # add current page to wallabag -config.bind(';w', "hint links userscript wallabag_add.sh") # add link to wallabag +config.bind(";w", "hint links userscript wallabag_add.sh") # add link to wallabag config.bind('"s', "add-shaarli", mode="normal") -config.bind(';s', "hint links userscript shaarli_add.sh") +config.bind(";s", "hint links userscript shaarli_add.sh") config.bind('"a', "send-to-archive", mode="normal")