## Autogenerated config.py
+##
+## NOTE: config.py is intended for advanced users who are comfortable
+## with manually migrating the config file on qutebrowser upgrades. If
+## you prefer, you can also configure qutebrowser using the
+## :set/:bind/:config-* commands without having to write a config.py
+## file.
+##
## Documentation:
## qute://help/configuring.html
## qute://help/settings.html
t = getenv('TERMINAL', 'xterm')
return [t, '-e'] + cmd
-## 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()
-
try:
from qutebrowser.api import interceptor, message
from PyQt5.QtCore import QUrl
except ImportError:
pass
+## 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(True)
+
## Aliases for commands. The keys of the given dictionary are the
## aliases, while the values are the commands they map to.
## Type: Dict
c.auto_save.session = True
## Backend to use to display websites. qutebrowser supports two different
-## web rendering engines / backends, QtWebKit and QtWebEngine. QtWebKit
-## was discontinued by the Qt project with Qt 5.6, but picked up as a
-## well maintained fork: https://github.com/annulen/webkit/wiki -
-## qutebrowser only supports the fork. QtWebEngine is Qt's official
-## successor to QtWebKit. It's slightly more resource hungry than
-## QtWebKit and has a couple of missing features in qutebrowser, but is
-## generally the preferred choice.
+## web rendering engines / backends, QtWebEngine and QtWebKit (not
+## recommended). QtWebEngine is Qt's official successor to QtWebKit, and
+## both the default/recommended backend. It's based on a stripped-down
+## Chromium and regularly updated with security fixes and new features by
+## the Qt project: https://wiki.qt.io/QtWebEngine QtWebKit was
+## qutebrowser's original backend when the project was started. However,
+## support for QtWebKit was discontinued by the Qt project with Qt 5.6 in
+## 2016. The development of QtWebKit was picked up in an official fork:
+## https://github.com/qtwebkit/qtwebkit - however, the project seems to
+## have stalled again. The latest release (5.212.0 Alpha 4) from March
+## 2020 is based on a WebKit version from 2016, with many known security
+## vulnerabilities. Additionally, there is no process isolation and
+## sandboxing. Due to all those issues, while support for QtWebKit is
+## still available in qutebrowser for now, using it is strongly
+## discouraged.
## Type: String
## Valid values:
-## - webengine: Use QtWebEngine (based on Chromium).
-## - webkit: Use QtWebKit (based on WebKit, similar to Safari).
+## - webengine: Use QtWebEngine (based on Chromium - recommended).
+## - webkit: Use QtWebKit (based on WebKit, similar to Safari - many known security issues!).
# c.backend = 'webengine'
-## This setting can be used to map keys to other keys. When the key used
-## as dictionary-key is pressed, the binding for the key used as
-## dictionary-value is invoked instead. This is useful for global
-## remappings of keys, for example to map Ctrl-[ to Escape. Note that
-## when a key is bound (via `bindings.default` or `bindings.commands`),
-## the mapping is ignored.
+## Map keys to other keys, so that they are equivalent in all modes. When
+## the key used as dictionary-key is pressed, the binding for the key
+## used as dictionary-value is invoked instead. This is useful for global
+## remappings of keys, for example to map <Ctrl-[> to <Escape>. NOTE:
+## This should only be used if two keys should always be equivalent, i.e.
+## for things like <Enter> (keypad) and <Return> (non-keypad). For normal
+## command bindings, qutebrowser works differently to vim: You always
+## bind keys to commands, usually via `:bind` or `config.bind()`. Instead
+## of using this setting, consider finding the command a key is bound to
+## (e.g. via `:bind gg`) and then binding the same command to the desired
+## key. Note that when a key is bound (via `bindings.default` or
+## `bindings.commands`), the mapping is ignored.
## Type: Dict
# c.bindings.key_mappings = {'<Ctrl-[>': '<Escape>', '<Ctrl-6>': '<Ctrl-^>', '<Ctrl-M>': '<Return>', '<Ctrl-J>': '<Return>', '<Ctrl-I>': '<Tab>', '<Shift-Return>': '<Return>', '<Enter>': '<Return>', '<Shift-Enter>': '<Return>', '<Ctrl-Enter>': '<Ctrl-Return>'}
## - smart: Apply dark mode based on image content. Not available with Qt 5.15.0.
# c.colors.webpage.darkmode.policy.images = 'smart'
-## Which pages to apply dark mode to.
+## Which pages to apply dark mode to. The underlying Chromium setting has
+## been removed in QtWebEngine 5.15.3, thus this setting is ignored
+## there. Instead, every element is now classified individually.
## Type: String
## Valid values:
## - always: Apply dark mode filter to all frames, regardless of content.
## Type: Int
# c.colors.webpage.darkmode.threshold.text = 256
-## Force `prefers-color-scheme: dark` colors for websites.
-## Type: Bool
-c.colors.webpage.prefers_color_scheme_dark = True
+## Value to use for `prefers-color-scheme:` for websites. The "light"
+## value is only available with QtWebEngine 5.15.2+. On older versions,
+## it is the same as "auto". The "auto" value is broken on QtWebEngine
+## 5.15.2 due to a Qt bug. There, it will fall back to "light"
+## unconditionally.
+## Type: String
+## Valid values:
+## - auto: Use the system-wide color scheme setting.
+## - light: Force a light theme.
+## - dark: Force a dark theme.
+# c.colors.webpage.preferred_color_scheme = 'auto'
## Number of commands to save in the command history. 0: no history / -1:
## unlimited
## A list of patterns which should not be shown in the history. This only
## affects the completion. Matching URLs are still saved in the history
-## (and visible on the qute://history page), but hidden in the
-## completion. Changing this setting will cause the completion history to
-## be regenerated on the next start, which will take a short while.
+## (and visible on the `:history` page), but hidden in the completion.
+## Changing this setting will cause the completion history to be
+## regenerated on the next start, which will take a short while.
## Type: List of UrlPattern
# c.completion.web_history.exclude = []
## Type: Bool
# c.content.blocking.enabled = True
+## Block subdomains of blocked hosts. Note: If only a single subdomain is
+## blocked but should be allowed, consider using
+## `content.blocking.whitelist` instead.
+## Type: Bool
+# c.content.blocking.hosts.block_subdomains = True
+
## List of URLs to host blocklists for the host blocker. Only used when
## the simple host-blocker is used (see `content.blocking.method`). The
## file can be in one of the following formats: - An `/etc/hosts`-like
## page cache allows for a nicer user experience when navigating forth or
## back to pages in the forward/back history, by pausing and resuming up
## to _n_ pages. For more information about the feature, please refer to:
-## http://webkit.org/blog/427/webkit-page-cache-i-the-basics/
+## https://webkit.org/blog/427/webkit-page-cache-i-the-basics/
## Type: Int
# c.content.cache.maximum_pages = 0
## unknown-3rdparty` per-domain on QtWebKit will have the same effect as
## `all`. If this setting is used with URL patterns, the pattern gets
## applied to the origin/first party URL of the page making the request,
-## not the request URL.
+## not the request URL. With QtWebEngine 5.15.0+, paths will be stripped
+## from URLs, so URL patterns using paths will not match. With
+## QtWebEngine 5.15.2+, subdomains are additionally stripped as well, so
+## you will typically need to set this setting for `example.com` when the
+## cookie is set on `somesubdomain.example.com` for it to work properly.
+## To debug issues with this setting, start qutebrowser with `--debug
+## --logfilter network --debug-flag log-cookies` which will show all
+## cookies being set.
## Type: String
## Valid values:
## - all: Accept all cookies.
## Try to pre-fetch DNS entries to speed up browsing.
## Type: Bool
-c.content.dns_prefetch = True
+# c.content.dns_prefetch = True
## Expand each subframe to its contents. This will flatten all the frames
## to become one scrollable page.
# c.content.headers.do_not_track = True
## When to send the Referer header. The Referer header tells websites
-## from which website you were coming from when visiting them. No restart
-## is needed with QtWebKit.
+## from which website you were coming from when visiting them. Note that
+## with QtWebEngine, websites can override this preference by setting the
+## `Referrer-Policy:` header, so that any websites visited from them get
+## the full referer. No restart is needed with QtWebKit.
## Type: String
## Valid values:
## - always: Always send the Referer.
## Type: FormatString
# c.content.headers.user_agent = 'Mozilla/5.0 ({os_info}) AppleWebKit/{webkit_version} (KHTML, like Gecko) {qt_key}/{qt_version} {upstream_browser_key}/{upstream_browser_version} Safari/{webkit_version}'
-## Enable host blocking.
-## Type: Bool
-# c.content.host_blocking.enabled = True
-
-## List of URLs of lists which contain hosts to block. The file can be
-## in one of the following formats: - An `/etc/hosts`-like file - One
-## host per line - A zip-file of any of the above, with either only one
-## file, or a file named `hosts` (with any extension). It's also
-## possible to add a local file or directory via a `file://` URL. In case
-## of a directory, all files in the directory are read as adblock lists.
-## The file `~/.config/qutebrowser/blocked-hosts` is always read if it
-## exists.
-## Type: List of Url
-# c.content.host_blocking.lists = ['https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts']
-
-## A list of patterns that should always be loaded, despite being ad-
-## blocked. Note this whitelists blocked hosts, not first-party URLs. As
-## an example, if `example.org` loads an ad from `ads.example.org`, the
-## whitelisted host should be `ads.example.org`. If you want to disable
-## the adblocker on a given page, use the `content.host_blocking.enabled`
-## setting with a URL pattern instead. Local domains are always exempt
-## from hostblocking.
-## Type: List of UrlPattern
-# c.content.host_blocking.whitelist = []
-
## Enable hyperlink auditing (`<a ping>`).
## Type: Bool
# c.content.hyperlink_auditing = False
config.set('content.notifications.enabled', True, '*://*.gitlab.com/*')
config.set('content.notifications.enabled', True, '*://*.google.com/*')
+## What notification presenter to use for web notifications. Note that
+## not all implementations support all features of notifications: - With
+## PyQt 5.14, any setting other than `qt` does not support the `click`
+## and `close` events, as well as the `tag` option to replace existing
+## notifications. - The `qt` and `systray` options only support showing
+## one notification at the time and ignore the `tag` option to replace
+## existing notifications. - The `herbe` option only supports showing one
+## notification at the time and doesn't show icons. - The `messages`
+## option doesn't show icons and doesn't support the `click` and
+## `close` events.
+## Type: String
+## Valid values:
+## - auto: Tries `libnotify`, `systray` and `messages`, uses the first one available without showing error messages.
+## - qt: Use Qt's native notification presenter, based on a system tray icon. Switching from or to this value requires a restart of qutebrowser. Recommended over `systray` on PyQt 5.14.
+## - libnotify: Shows messages via DBus in a libnotify-compatible way. If DBus isn't available, falls back to `systray` or `messages`, but shows an error message.
+## - systray: Use a notification presenter based on a systray icon. Falls back to `libnotify` or `messages` if not systray is available. This is a reimplementation of the `qt` setting value, but with the possibility to switch to it at runtime.
+## - messages: Show notifications as qutebrowser messages. Most notification features aren't available.
+## - herbe: (experimental!) Show notifications using herbe (github.com/dudik/herbe). Most notification features aren't available.
+# c.content.notifications.presenter = 'auto'
+
+## Whether to show the origin URL for notifications. Note that URL
+## patterns with this setting only get matched against the origin part of
+## the URL, so e.g. paths in patterns will never match. Note that with
+## the `qt` presenter, origins are never shown.
+## Type: Bool
+# c.content.notifications.show_origin = True
+
## 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
## viewer.
## Type: Bool
# c.content.plugins = False
+## Request websites to minimize non-essentials animations and motion.
+## This results in the `prefers-reduced-motion` CSS media query to
+## evaluate to `reduce` (rather than `no-preference`). On Windows, if
+## this setting is set to False, the system-wide animation setting is
+## considered.
+## Type: Bool
+# c.content.prefers_reduced_motion = False
+
## Draw the background color and images also when the page is printed.
## Type: Bool
# c.content.print_element_backgrounds = True
## Enable quirks (such as faked user agent headers) needed to get
## specific sites to work properly.
## Type: Bool
-# c.content.site_specific_quirks = True
+# c.content.site_specific_quirks.enabled = True
-## Validate SSL handshakes.
-## Type: BoolAsk
+## Disable a list of named quirks. The js-string-replaceall quirk is
+## needed for Nextcloud Calendar < 2.2.0 with QtWebEngine < 5.15.3.
+## However, the workaround is not fully compliant to the ECMAScript spec
+## and might cause issues on other websites, so it's disabled by default.
+## Type: FlagList
## Valid values:
-## - true
-## - false
-## - ask
-# c.content.ssl_strict = 'ask'
+## - ua-whatsapp
+## - ua-google
+## - ua-slack
+## - ua-googledocs
+## - js-whatsapp-web
+## - js-discord
+## - js-string-replaceall
+## - js-globalthis
+## - js-object-fromentries
+## - misc-krunker
+## - misc-mathml-darkmode
+# c.content.site_specific_quirks.skip = ['js-string-replaceall']
+
+## How to proceed on TLS certificate errors.
+## Type: String
+## Valid values:
+## - ask: Ask how to proceed for every certificate error (unless non-overridable due to HSTS).
+## - ask-block-thirdparty: Ask how to proceed for normal page loads, but silently block resource loads.
+## - block: Automatically block loading on certificate errors.
+## - load-insecurely: Force loading pages despite certificate errors. This is *insecure* and should be avoided. Instead of using this, consider fixing the underlying issue or importing a self-signed certificate via `certutil` (or Chromium) instead.
+# c.content.tls.certificate_errors = 'ask'
## How navigation requests to URLs with unknown schemes are handled.
## Type: String
## - bottom
# c.downloads.position = 'top'
+## Automatically abort insecure (HTTP) downloads originating from secure
+## (HTTPS) pages. For per-domain settings, the relevant URL is the URL
+## initiating the download, not the URL the download itself is coming
+## from. It's not recommended to set this setting to false globally.
+## Type: Bool
+# c.downloads.prevent_mixed_content = True
+
## Duration (in milliseconds) to wait before removing finished downloads.
## If set to -1, downloads are never removed.
## Type: Int
c.fileselect.handler = 'external'
## Command (and arguments) to use for selecting multiple files in forms.
-## The command should write the selected file paths to the specified
-## file, separated by newlines. The following placeholders are defined: *
-## `{}`: Filename of the file to be written to.
+## The command should write the selected file paths to the specified file
+## or to stdout, separated by newlines. The following placeholders are
+## defined: * `{}`: Filename of the file to be written to. If not
+## contained in any argument, the standard output of the command is
+## read instead.
## Type: ShellCommand
c.fileselect.multiple_files.command = in_terminal(['ranger', '--choosefiles={}'])
## Command (and arguments) to use for selecting a single file in forms.
-## The command should write the selected file path to the specified file.
-## The following placeholders are defined: * `{}`: Filename of the file
-## to be written to.
+## The command should write the selected file path to the specified file
+## or stdout. The following placeholders are defined: * `{}`: Filename of
+## the file to be written to. If not contained in any argument, the
+## standard output of the command is read instead.
## Type: ShellCommand
c.fileselect.multiple_files.command = in_terminal(['ranger', '--choosefile={}'])
## Leave hint mode when starting a new page load.
## Type: Bool
-# c.hints.leave_on_load = True
+# c.hints.leave_on_load = False
## Minimum number of characters used for hint strings.
## Type: Int
## Type: Bool
# c.input.links_included_in_focus_chain = True
+## Whether the underlying Chromium should handle media keys. On Linux,
+## disabling this also disables Chromium's MPRIS integration.
+## Type: Bool
+# c.input.media_keys = True
+
## Enable back and forward buttons on the mouse.
## Type: Bool
# c.input.mouse.back_forward_buttons = True
## cleared after this time. If set to 0, partially typed bindings are
## never cleared.
## Type: Int
-c.input.partial_timeout = 0
+# c.input.partial_timeout = 0
## Enable spatial navigation. Spatial navigation consists in the ability
## to navigate between focusable elements in a Web page, such as
## Duration (in milliseconds) to show messages in the statusbar for. Set
## to 0 to never clear messages.
## Type: Int
-# c.messages.timeout = 2000
+# c.messages.timeout = 3000
## How to open links in an existing instance if a new one is launched.
## This happens when e.g. opening a link from a terminal. See
## - single-process: Run all tabs in a single process. This should be used for debugging purposes only, and it disables `:open --private`.
# c.qt.process_model = 'process-per-site-instance'
+## Work around locale parsing issues in QtWebEngine 5.15.3. With some
+## locales, QtWebEngine 5.15.3 is unusable without this workaround. In
+## affected scenarios, QtWebEngine will log "Network service crashed,
+## restarting service." and only display a blank page. However, It is
+## expected that distributions shipping QtWebEngine 5.15.3 follow up with
+## a proper fix soon, so it is disabled by default.
+## Type: Bool
+# c.qt.workarounds.locale = False
+
+## Delete the QtWebEngine Service Worker directory on every start. This
+## workaround can help with certain crashes caused by an unknown
+## QtWebEngine bug related to Service Workers. Those crashes happen
+## seemingly immediately on Windows; after one hour of operation on other
+## systems. Note however that enabling this option *can lead to data
+## loss* on some pages (as Service Worker data isn't persisted) and will
+## negatively impact start-up time.
+## Type: Bool
+# c.qt.workarounds.remove_service_workers = False
+
## When/how to show the scrollbar.
## Type: String
## Valid values:
# c.statusbar.show = 'always'
## List of widgets displayed in the statusbar.
-## Type: List of String
+## Type: List of StatusbarWidget
## Valid values:
## - url: Current page URL.
## - scroll: Percentage of the current page position like `10%`.
## - tabs: Current active tab, e.g. `2`.
## - keypress: Display pressed keys when composing a vi command.
## - progress: Progress bar for the current page loading.
+## - text:foo: Display the static text after the colon, `foo` in the example.
# c.statusbar.widgets = ['keypress', 'url', 'scroll', 'history', 'tabs', 'progress']
## Open new tabs (middleclick/ctrl+click) in the background.
# config.bind('PP', 'open -t -- {primary}')
# config.bind('Pp', 'open -t -- {clipboard}')
# config.bind('R', 'reload -f')
-# config.bind('Sb', 'open qute://bookmarks#bookmarks')
-# config.bind('Sh', 'open qute://history')
-# config.bind('Sq', 'open qute://bookmarks')
-# config.bind('Ss', 'open qute://settings')
-# config.bind('T', 'tab-focus')
+# config.bind('Sb', 'bookmark-list --jump')
+# config.bind('Sh', 'history')
+# config.bind('Sq', 'bookmark-list')
+# config.bind('Ss', 'set')
+# config.bind('T', 'set-cmd-text -sr :tab-focus')
# config.bind('U', 'undo -w')
# config.bind('V', 'mode-enter caret ;; selection-toggle --line')
# config.bind('ZQ', 'quit')
# config.bind('gi', 'hint inputs --first')
# config.bind('gm', 'tab-move')
# config.bind('go', 'set-cmd-text :open {url:pretty}')
+# config.bind('gt', 'set-cmd-text -s :tab-select')
# config.bind('gu', 'navigate up')
# config.bind('h', 'scroll left')
# config.bind('i', 'mode-enter insert')
## Bindings for insert mode
# config.bind('<Ctrl-E>', 'edit-text', mode='insert')
# config.bind('<Escape>', 'mode-leave', mode='insert')
+# config.bind('<Shift-Escape>', 'fake-key <Escape>', mode='insert')
# config.bind('<Shift-Ins>', 'insert-text -- {primary}', mode='insert')
## Bindings for passthrough mode