From: Samir Benmendil Date: Tue, 26 Jan 2021 00:15:35 +0000 (+0000) Subject: qutebrowser: add proxy-pac to qt.args X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/1c89bd14849b914e9c62febdb065fbf66db53aed?ds=sidebyside qutebrowser: add proxy-pac to qt.args This defines which proxy (if at all) to use for which urls. It requires qutebrowser to be patched to not load it's own proxy handling as that seems to overwrite this. This used to be set with QTWEBENGINE_CHROMIUM_FLAGS environment variable in an untracked qutebrowser wrapper in PATH. It caused some issues with darkmode though, as it seems that this env variable is not overwritten when already set, and the correct darkmode settings are not being passed to blink. Setting the proxy file as qt.args works also with darkmode. --- diff --git a/qutebrowser/config.py b/qutebrowser/config.py index a7d422b..2378f63 100644 --- a/qutebrowser/config.py +++ b/qutebrowser/config.py @@ -1496,7 +1496,7 @@ c.input.partial_timeout = 5000 ## https://peter.sh/experiments/chromium-command-line-switches/ for a ## list) will work. ## Type: List of String -# c.qt.args = [] +c.qt.args = [str('proxy-pac-url=file://' / config.configdir / 'proxy.pac')] ## Additional environment variables to set. Setting an environment ## variable to null/None will unset it. diff --git a/qutebrowser/proxy.pac b/qutebrowser/proxy.pac new file mode 100644 index 0000000..8d2ec82 --- /dev/null +++ b/qutebrowser/proxy.pac @@ -0,0 +1,11 @@ +function FindProxyForURL(url, host) { + if (shExpMatch(host, "*slack*")) { + return "DIRECT"; + } + if (shExpMatch(host, "*focalpointpositioning*")) + { + return "SOCKS5 localhost:1080"; + } + + return "DIRECT"; +}