diff --git a/.appveyor.yml b/.appveyor.yml index 92a20c0bd..42baac6c9 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -5,15 +5,15 @@ cache: build: off environment: PYTHONUNBUFFERED: 1 - PYTHON: C:\Python36-x64\python.exe + PYTHON: C:\Python37-x64\python.exe matrix: - - TESTENV: py36-pyqt511 + - TESTENV: py37-pyqt512 - TESTENV: pylint install: - '%PYTHON% -m pip install -U pip' - '%PYTHON% -m pip install -r misc\requirements\requirements-tox.txt' - - 'set PATH=C:\Python36-x64;%PATH' + - 'set PATH=C:\Python37-x64;%PATH' test_script: - '%PYTHON% -m tox -e %TESTENV%' diff --git a/.coveragerc b/.coveragerc index 9ba8e8a5e..69b126e12 100644 --- a/.coveragerc +++ b/.coveragerc @@ -14,6 +14,7 @@ exclude_lines = raise NotImplementedError raise utils\.Unreachable if __name__ == ["']__main__["']: + if MYPY: [xml] output=coverage.xml diff --git a/.flake8 b/.flake8 index 8c03ef729..04c491bf2 100644 --- a/.flake8 +++ b/.flake8 @@ -46,11 +46,11 @@ ignore = min-version = 3.4.0 max-complexity = 12 per-file-ignores = - /tests/**/*.py : D100,D101,D401 - /tests/unit/browser/test_history.py : N806 - /tests/helpers/fixtures.py : N806 - /tests/unit/browser/webkit/http/test_content_disposition.py : D400 - /scripts/dev/ci/appveyor_install.py : FI53 + qutebrowser/api/hook.py : N801 + tests/* : D100,D101 + tests/unit/browser/test_history.py : D100,D101,N806 + tests/helpers/fixtures.py : D100,D101,N806 + tests/unit/browser/webkit/http/test_content_disposition.py : D100,D101,D400 copyright-check = True copyright-regexp = # Copyright [\d-]+ .* copyright-min-file-size = 110 diff --git a/.github/CONTRIBUTING.asciidoc b/.github/CONTRIBUTING.asciidoc index d0fa243e9..bf9f0e66b 100644 --- a/.github/CONTRIBUTING.asciidoc +++ b/.github/CONTRIBUTING.asciidoc @@ -1,10 +1,6 @@ -IMPORTANT: *Currently, bigger changes are going on in qutebrowser, as -part of a -https://lists.schokokeks.org/pipermail/qutebrowser-announce/2018-September/000051.html[student research project] -about adding a plugin API to qutebrowser and moving a lot of code from the code -into plugins.* Due to that, bandwidth for pull request review is currently -very limited, and contributions might lead to merge conflicts due to -ongoing refactorings. +IMPORTANT: Bandwidth for pull request review is currently quite limited. If you +want to contribute where it's most needed, please consider reviewing or testing +open pull requests. - Before you start to work on something, please leave a comment on the relevant issue (or open one). This makes sure there is no duplicate work done. diff --git a/.github/ISSUE_TEMPLATE/1_Bug_report.md b/.github/ISSUE_TEMPLATE/1_Bug_report.md index 56566849d..5e86b9a76 100644 --- a/.github/ISSUE_TEMPLATE/1_Bug_report.md +++ b/.github/ISSUE_TEMPLATE/1_Bug_report.md @@ -6,7 +6,7 @@ about: Report errors and problems **Version info (see `:version`)**: -**Does the bug happen if you start with `--temp-basedir`?** (if applicable): +**Does the bug happen if you start with `--temp-basedir`?**: **Description** diff --git a/.gitignore b/.gitignore index 9efceef63..ceafd9946 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ TODO /scripts/testbrowser/cpp/webengine/.qmake.stash /scripts/dev/pylint_checkers/qute_pylint.egg-info /misc/file_version_info.txt +/doc/extapi/_build diff --git a/.travis.yml b/.travis.yml index 5b918a393..f0959d2a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,74 +1,87 @@ dist: xenial language: python group: edge -python: 3.6 +python: 3.7 +os: linux matrix: + fast_finish: true include: - - os: linux - env: DOCKER=archlinux + ### Archlinux QtWebKit + - env: DOCKER=archlinux services: docker - - os: linux - env: DOCKER=archlinux-webengine QUTE_BDD_WEBENGINE=true + + ### Archlinux QtWebEngine + - env: DOCKER=archlinux-webengine QUTE_BDD_WEBENGINE=true services: docker - - os: linux - env: TESTENV=py36-pyqt571 - - os: linux - python: 3.5 + + ### PyQt 5.7.1 (Python 3.5) + - python: 3.5 env: TESTENV=py35-pyqt571 - - os: linux - env: TESTENV=py36-pyqt59 - - os: linux - env: TESTENV=py36-pyqt510 + ### PyQt 5.7.1 (Python 3.6) + - python: 3.6 + env: TESTENV=py36-pyqt571 + + ### PyQt 5.9 + - env: TESTENV=py37-pyqt59 + + ### PyQt 5.10 + - env: TESTENV=py37-pyqt510 addons: apt: packages: - xfonts-base - - os: linux - env: TESTENV=py36-pyqt511-cov - - os: linux - python: 3.7 - env: TESTENV=py37-pyqt511 + + ### PyQt 5.11 + - env: TESTENV=py37-pyqt511 + + ### PyQt 5.12 (Python 3.7, with coverage) + - env: TESTENV=py37-pyqt512-cov + # http://code.qt.io/cgit/qt/qtbase.git/commit/?id=c3a963da1f9e7b1d37e63eedded61da4fbdaaf9a + addons: + apt: + packages: + - libxkbcommon-x11-0 + + ### macOS sierra - os: osx - env: TESTENV=py37 OSX=sierra + env: TESTENV=py37-pyqt512 OSX=sierra osx_image: xcode9.2 language: generic + ### macOS yosemite # https://github.com/qutebrowser/qutebrowser/issues/2013 # - os: osx # env: TESTENV=py35 OSX=yosemite # osx_image: xcode6.4 - - os: linux - env: TESTENV=pylint PYTHON=python3.6 - - os: linux - env: TESTENV=flake8 - - os: linux - env: TESTENV=docs + + ### pylint/flake8/mypy + - env: TESTENV=pylint + - env: TESTENV=flake8 + - env: TESTENV=mypy + + ### docs + - env: TESTENV=docs addons: apt: packages: - asciidoc - - os: linux - env: TESTENV=vulture - - os: linux - env: TESTENV=misc - - os: linux - env: TESTENV=pyroma - - os: linux - env: TESTENV=check-manifest - - os: linux - env: TESTENV=eslint + + ### vulture/misc/pyroma/check-manifest + - env: TESTENV=vulture + - env: TESTENV=misc + - env: TESTENV=pyroma + - env: TESTENV=check-manifest + + ### eslint + - env: TESTENV=eslint language: node_js python: null node_js: "lts/*" - - os: linux - language: generic + + ### shellcheck + - language: generic env: TESTENV=shellcheck services: docker - fast_finish: true - allow_failures: - # https://github.com/qutebrowser/qutebrowser/issues/4055 - - os: linux - env: TESTENV=py36-pyqt510 cache: directories: @@ -87,16 +100,3 @@ after_success: after_failure: - bash scripts/dev/ci/travis_backtrace.sh - -notifications: - webhooks: - - https://buildtimetrend.herokuapp.com/travis - irc: - channels: - - "chat.freenode.net#qutebrowser-dev" - on_success: always - on_failure: always - skip_join: true - template: - - "%{repository}#%{build_number} (%{branch} - %{commit} : %{author}): %{message}" - - "%{compare_url} - %{build_url}" diff --git a/MANIFEST.in b/MANIFEST.in index ff96264aa..49b1a383b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -12,8 +12,8 @@ recursive-include scripts *.py *.sh *.js include qutebrowser/utils/testfile include qutebrowser/git-commit-id include LICENSE doc/* README.asciidoc -include misc/qutebrowser.desktop -include misc/qutebrowser.appdata.xml +include misc/org.qutebrowser.qutebrowser.desktop +include misc/org.qutebrowser.qutebrowser.appdata.xml include misc/Makefile include requirements.txt include tox.ini @@ -32,6 +32,7 @@ include doc/changelog.asciidoc prune tests prune qutebrowser/3rdparty exclude pytest.ini +exclude mypy.ini exclude qutebrowser/javascript/.eslintrc.yaml exclude qutebrowser/javascript/.eslintignore exclude doc/help @@ -39,5 +40,6 @@ exclude .* exclude misc/qutebrowser.spec exclude misc/qutebrowser.nsi exclude misc/qutebrowser.rcc +prune doc/extapi global-exclude __pycache__ *.pyc *.pyo diff --git a/README.asciidoc b/README.asciidoc index b2d882eae..334c0561e 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -97,7 +97,7 @@ Requirements The following software and libraries are required to run qutebrowser: * https://www.python.org/[Python] 3.5 or newer (3.6 recommended) -* https://www.qt.io/[Qt] 5.7.1 or newer (5.11 recommended, support for < 5.9 +* https://www.qt.io/[Qt] 5.7.1 or newer (5.12 recommended, support for < 5.9 will be dropped soon) with the following modules: - QtCore / qtbase - QtQuick (part of qtbase in some distributions) @@ -108,7 +108,7 @@ The following software and libraries are required to run qutebrowser: only the link:https://github.com/annulen/webkit/wiki[updated fork] (5.212) is supported * https://www.riverbankcomputing.com/software/pyqt/intro[PyQt] 5.7.0 or newer - (5.11 recommended, support for < 5.9 will be dropped soon) for Python 3 + (5.12 recommended, support for < 5.9 will be dropped soon) for Python 3 * https://pypi.python.org/pypi/setuptools/[pkg_resources/setuptools] * https://fdik.org/pyPEG/[pyPEG2] * http://jinja.pocoo.org/[jinja2] diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index a4f5e50a5..4101769ac 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -15,32 +15,91 @@ breaking changes (such as renamed commands) can happen in minor releases. // `Fixed` for any bug fixes. // `Security` to invite users to upgrade in case of vulnerabilities. -v1.6.0 (unreleased) +v1.7.0 (unreleased) ------------------- Added ~~~~~ -- New `tabs.new_position.stacking` setting which controls whether new tabs - opened from a page should stack on each other or not. -- New `completion.open_categories` setting which allows to configure which - categories are shown in the `:open` completion, and how they are ordered. +- New settings: + * `colors.tabs.pinned.*` to control colors of pinned tabs. + +Changed +~~~~~~~ + +- The desktop file `qutebrowser.desktop` is now renamed to + `org.qutebrowser.qutebrowser.desktop`. +- Pinned tabs now always show a favicon (even if the site doesn't provide one) + when shrinking. + +Fixed +~~~~~ + +v1.6.1 +------ + +Changed +~~~~~~~ + +- Windows/macOS releases now ship with Qt 5.12.2, which includes + security fixes up to Chromium 72.0.3626.121 (including CVE-2019-5786 + which is known to be exploited in the wild). + +Fixed +~~~~~ + +- Crash when using `:config-{dict,list}-{add,remove}` with an invalid setting. +- Functionality like hinting on pages with an element with ID `_qutebrowser` (such as qutebrowser.org) on Qt 5.12. +- The .desktop file in v1.6.0 was missing the "Actions" key, which is now fixed. +- The SVG icon now has a size of 256x256px set to comply with freedesktop standards. +- Setting `colors.statusbar.*.bg` to a gradient now has the expected effect of + the gradient spanning the entire statusbar. + +v1.6.0 +------ + +Added +~~~~~ + +- New settings: + * `tabs.new_position.stacking` which controls whether new tabs opened from a + page should stack on each other or not. + * `completion.open_categories` which allows to configure which categories are + shown in the `:open` completion, and how they are ordered. + * `tabs.pinned.frozen` to allow/deny navigating in pinned tabs. + * `hints.selectors` which allows to configure what CSS selectors are used for + hints, and also allows adding custom hint groups. + * `input.insert_mode.leave_on_load` to turn off leaving insert mode when a + new page is loaded. - New config manipulation commands: * `:config-dict-add` and `:config-list-add` to a new element to a dict/list setting. * `:config-dict-remove` and `:config-list-remove` to remove an element from a dict/list setting. -- New `hints.selectors` setting which allows to configure what CSS selectors - are used for hints, and also allows adding custom hint groups. - New `:yank markdown` feature which yanks the current URL and title in markdown format. - New command `:navigate strip` which removes queries and parameters from the current URL (bound to `gs`/`gS` by default). +- Support for new QtWebEngine features in Qt 5.12: + * Basic support for client certificates. Selecting the certificate to use + when there are multiple matching certificates isn't implemented yet. + * Support for DNS prefetching (plus new `content.dns_prefetch` setting). Changed ~~~~~~~ -- `:q` now closes current window instead of quitting qutebrowser completely +- Various changes to the Windows and macOS builds: + * Bundling Qt 5.12.1, based on Chromium 69.0.3497.128 with security fixes up + to 71.0.3578.94. + * Windows: A 32-bit build is available again. + * Windows: The builds now bundle the Universal CRT DLLs, causing them to work + on earlier versions of Windows 10. + * macOS: Support for OS X 10.11 El Capitan was dropped, requiring macOS 10.12 + Sierra or newer. + * macOS: The IPC socket path used to communicate with existing instances + changed due to changes in Qt 5.12. Please make sure to quit qutebrowser + before upgrading. +- `:q` now closes the current window instead of quitting qutebrowser completely (`:close`), while `:qa` quits (`:quit`). The behavior of `:wq` remains unchanged (`:quit --save`), as closing a window while saving the session doesn't make sense. @@ -53,6 +112,20 @@ Changed adblocker can be disabled on a given page. - Elements with a `tabindex` attribute now also get hints by default. - Various small performance improvements for hints and the completion. +- The Wayland check for QtWebEngine is now disabled on Qt >= 5.11.2, as those + versions should work without any issues. +- The JavaScript `console` object is now available in PAC files. +- PAC proxies currently don't work properly on QtWebEngine (and never did), so + an error is now shown when trying to configure a PAC proxy. +- The metainfo file `qutebrowser.appdata.xml` is now renamed to + `org.qutebrowser.qutebrowser.appdata.xml`. +- The `qute-pass` userscript now understands domains in gpg filenames + in addition to directory names. +- The autocompletion for `content.headers.user_agent` got updated to only + include the default and Chrome, as setting the UA to Firefox has various + bad side-effects. +- Combining Qt 5.12 with an older PyQt can lead to issues, so a warning is + now shown when starting qutebrowser with that combination. Fixed ~~~~~ @@ -67,7 +140,28 @@ Fixed `content.cookies.accept = no-3rdparty` from working properly on some pages like GMail. However, the default for `content.cookies.accept` is still `all` to be in line with what other browsers do. -- `:navigate` not incrementing in anchors or queries or anchors. +- `:navigate` not incrementing in anchors or queries. +- Crash when trying to use a proxy requiring authentication with QtWebKit. +- Slashes in search terms are now percent-escaped. +- When `scrolling.bar = True` was set in versions before v1.5.0, this now + correctly gets migrated to `always` instead of `when-searching`. +- Completion highlighting now works again on Qt 5.11.3 and 5.12.1. +- The non-standard header `X-Do-Not-Track` is no longer sent. +- PAC proxies were never correctly supported with QtWebEngine, but are now + explicitly disallowed. +- macOS: Context menus for download items now show in the correct macOS style. +- Issues with fullscreen handling when exiting a video player. +- Various fixes for Qt 5.12 issues: + * A javascript error on page load was fixed. + * `window.print()` works with Qt 5.12 now. + * Fixed handling of duplicate download filenames. + * Fixed broken `qute://history` page. + * Fixed PDF.js not working properly. + * The download button in PDF.js now works (it's not possible to make + it work with earlier Qt versions). + * Since Greasemonkey scripts modifying the DOM fail when being run at + document-start, some known-broken scripts (Iridium, userstyles.org) are now + forced to run at document-end. v1.5.2 ------ @@ -367,11 +461,11 @@ v1.3.3 Security ~~~~~~~~ -- An XSS vulnerability on the `qute://history` page allowed websites to inject - HTML into the page via a crafted title tag. This could allow them to steal - your browsing history. If you're currently unable to upgrade, avoid using - `:history`. A CVE request for this issue is pending, see - https://github.com/qutebrowser/qutebrowser/issues/4011[#4011] for updates. +- CVE-2018-1000559: An XSS vulnerability on the `qute://history` page allowed + websites to inject HTML into the page via a crafted title tag. This could + allow them to steal your browsing history. If you're currently unable to + upgrade, avoid using `:history`. See the related GitHub issue for details: + https://github.com/qutebrowser/qutebrowser/issues/4011. Fixed ~~~~~ diff --git a/doc/contributing.asciidoc b/doc/contributing.asciidoc index 1a2369516..6fe6fb740 100644 --- a/doc/contributing.asciidoc +++ b/doc/contributing.asciidoc @@ -5,13 +5,9 @@ The Compiler :data-uri: :toc: -IMPORTANT: *Currently, bigger changes are going on in qutebrowser, as -part of a -https://lists.schokokeks.org/pipermail/qutebrowser-announce/2018-September/000051.html[student research project] -about adding a plugin API to qutebrowser and moving a lot of code from the code -into plugins.* Due to that, bandwidth for pull request review is currently -very limited, and contributions might lead to merge conflicts due to -ongoing refactorings. +IMPORTANT: Bandwidth for pull request review is currently quite limited. If you +want to contribute where it's most needed, please consider reviewing or testing +open pull requests. I `<3` footnote:[Of course, that says `<3` in HTML.] contributors! @@ -222,7 +218,7 @@ Some resources which might be handy: * http://doc.qt.io/qt-5/classes.html[The Qt5 reference] * https://docs.python.org/3/library/index.html[The Python reference] * http://httpbin.org/[httpbin, a test service for HTTP requests/responses] -* http://requestb.in/[RequestBin, a service to inspect HTTP requests] +* https://requestbin.com/[RequestBin, a service to inspect HTTP requests] Documentation of used Python libraries: @@ -407,7 +403,7 @@ Creating a new command is straightforward: [source,python] ---- -import qutebrowser.commands.cmdutils +from qutebrowser.api import cmdutils ... @@ -429,7 +425,7 @@ selects which object registry (global, per-tab, etc.) to use. See the There are also other arguments to customize the way the command is registered; see the class documentation for `register` in -`qutebrowser.commands.cmdutils` for details. +`qutebrowser.api.cmdutils` for details. The types of the function arguments are inferred based on their default values, e.g., an argument `foo=True` will be converted to a flag `-f`/`--foo` in @@ -480,8 +476,10 @@ For `typing.Union` types, the given `choices` are only checked if other types The following arguments are supported for `@cmdutils.argument`: - `flag`: Customize the short flag (`-x`) the argument will get. -- `win_id=True`: Mark the argument as special window ID argument. -- `count=True`: Mark the argument as special count argument. +- `value`: Tell qutebrowser to fill the argument with special values: + - `value=cmdutils.Value.count`: The `count` given by the user to the command. + - `value=cmdutils.Value.win_id`: The window ID of the current window. + - `value=cmdutils.Value.cur_tab`: The tab object which is currently focused. - `completion`: A completion function (see `qutebrowser.completions.models.*`) to use when completing arguments for the given command. - `choices`: The allowed string choices for the argument. @@ -606,7 +604,7 @@ Style conventions ----------------- qutebrowser's coding conventions are based on -http://legacy.python.org/dev/peps/pep-0008/[PEP8] and the https://google-styleguide.googlecode.com/svn/trunk/pyguide.html[Google Python style guidelines] with some additions: +http://legacy.python.org/dev/peps/pep-0008/[PEP8] and the https://google.github.io/styleguide/pyguide.html[Google Python style guidelines] with some additions: * The _Raise:_ section is not added to the docstring. * Methods overriding Qt methods (obviously!) don't follow the naming schemes. @@ -708,6 +706,7 @@ qutebrowser release * Update changelog (remove *(unreleased)*). * Adjust `__version_info__` in `qutebrowser/__init__.py`. +* Consider updating the completions for `content.headers.user_agent` in `configdata.yml`. * Commit. * Create annotated git tag (`git tag -s "v1.$x.$y" -m "Release v1.$x.$y"`). @@ -721,7 +720,7 @@ as closed. * Windows: Run `git checkout v1.X.Y; py -3 scripts\dev\build_release.py --asciidoc C:\Python27\python %userprofile%\bin\asciidoc-8.6.10\asciidoc.py --upload v1.X.Y` (replace X/Y by hand). * macOS: Run `git checkout v1.X.Y && python3 scripts/dev/build_release.py --upload v1.X.Y` (replace X/Y by hand). * On server: - - Run `python3 scripts/dev/download_release.py v1.X.Y` (replace X/Y by hand). + - Run `bash download_release.sh 1.X.Y` (replace X/Y by hand). - Run `git pull github master && sudo python3 scripts/asciidoc2html.py --website /srv/http/qutebrowser` * Update `qutebrowser-git` PKGBUILD if dependencies/install changed. * Announce to qutebrowser and qutebrowser-announce mailinglist. diff --git a/doc/extapi/_static/.gitkeep b/doc/extapi/_static/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/doc/extapi/_templates/.gitkeep b/doc/extapi/_templates/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/doc/extapi/api.rst b/doc/extapi/api.rst new file mode 100644 index 000000000..b63db57c3 --- /dev/null +++ b/doc/extapi/api.rst @@ -0,0 +1,48 @@ +API modules +=========== + +cmdutils module +--------------- + +.. automodule:: qutebrowser.api.cmdutils + :members: + :imported-members: + +apitypes module +--------------- + +.. automodule:: qutebrowser.api.apitypes + :members: + :imported-members: + +config module +------------- + +.. automodule:: qutebrowser.api.config + :members: + +downloads module +---------------- + +.. automodule:: qutebrowser.api.downloads + :members: + +hook module +----------- + +.. automodule:: qutebrowser.api.hook + :members: + +interceptor module +------------------ + +.. automodule:: qutebrowser.api.interceptor + :members: + :imported-members: + +message module +-------------- + +.. automodule:: qutebrowser.api.message + :members: + :imported-members: diff --git a/doc/extapi/conf.py b/doc/extapi/conf.py new file mode 100644 index 000000000..aba5e93af --- /dev/null +++ b/doc/extapi/conf.py @@ -0,0 +1,179 @@ +# -*- coding: utf-8 -*- +# +# Configuration file for the Sphinx documentation builder. +# +# This file does only contain a selection of the most common options. For a +# full list see the documentation: +# http://www.sphinx-doc.org/en/master/config + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- + +project = 'qutebrowser extensions' +copyright = '2018-2019, Florian Bruhin' +author = 'Florian Bruhin' + +# The short X.Y version +version = '' +# The full version, including alpha/beta/rc tags +release = '' + + +# -- General configuration --------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.napoleon', +] +autodoc_member_order = 'bysource' + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = None + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'alabaster' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +# html_theme_options = {} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# The default sidebars (for documents that don't match any pattern) are +# defined by theme itself. Builtin themes are using these templates by +# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', +# 'searchbox.html']``. +# +# html_sidebars = {} + + +# -- Options for HTMLHelp output --------------------------------------------- + +# Output file base name for HTML help builder. +htmlhelp_basename = 'qutebrowserextensionsdoc' + + +# -- Options for LaTeX output ------------------------------------------------ + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'qutebrowserextensions.tex', 'qutebrowser extensions Documentation', + 'Florian Bruhin', 'manual'), +] + + +# -- Options for manual page output ------------------------------------------ + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'qutebrowserextensions', 'qutebrowser extensions Documentation', + [author], 1) +] + + +# -- Options for Texinfo output ---------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'qutebrowserextensions', 'qutebrowser extensions Documentation', + author, 'qutebrowserextensions', 'One line description of project.', + 'Miscellaneous'), +] + + +# -- Options for Epub output ------------------------------------------------- + +# Bibliographic Dublin Core info. +epub_title = project + +# The unique identifier of the text. This can be a ISBN number +# or the project homepage. +# +# epub_identifier = '' + +# A unique identification for the text. +# +# epub_uid = '' + +# A list of files that should not be packed into the epub file. +epub_exclude_files = ['search.html'] + + +# -- Extension configuration ------------------------------------------------- diff --git a/doc/extapi/index.rst b/doc/extapi/index.rst new file mode 100644 index 000000000..d181c2ccd --- /dev/null +++ b/doc/extapi/index.rst @@ -0,0 +1,22 @@ +.. qutebrowser extensions documentation master file, created by + sphinx-quickstart on Tue Dec 11 18:59:44 2018. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to qutebrowser extensions's documentation! +================================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + api + tab + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/doc/extapi/tab.rst b/doc/extapi/tab.rst new file mode 100644 index 000000000..57a14ac6e --- /dev/null +++ b/doc/extapi/tab.rst @@ -0,0 +1,44 @@ +Tab API +======= + +.. autoclass:: qutebrowser.browser.browsertab.AbstractTab() + :members: + +.. autoclass:: qutebrowser.browser.browsertab.AbstractAction() + :members: + +.. autoclass:: qutebrowser.browser.browsertab.AbstractPrinting() + :members: + +.. autoclass:: qutebrowser.browser.browsertab.AbstractSearch() + :members: + +.. autoclass:: qutebrowser.browser.browsertab.AbstractZoom() + :members: + +.. autoclass:: qutebrowser.browser.browsertab.AbstractCaret() + :members: + +.. autoclass:: qutebrowser.browser.browsertab.AbstractScroller() + :members: + +.. autoclass:: qutebrowser.browser.browsertab.AbstractHistory() + :members: + +.. autoclass:: qutebrowser.browser.browsertab.AbstractElements() + :members: + +.. autoclass:: qutebrowser.browser.browsertab.AbstractAudio() + :members: + +Web element API +=============== + +.. autoclass:: qutebrowser.browser.webelem.AbstractWebElement + :members: + +.. autoclass:: qutebrowser.browser.webelem.Error + :members: + +.. autoclass:: qutebrowser.browser.webelem.OrphanedError + :members: diff --git a/doc/faq.asciidoc b/doc/faq.asciidoc index 6687917c7..10661cb9e 100644 --- a/doc/faq.asciidoc +++ b/doc/faq.asciidoc @@ -211,9 +211,10 @@ Why does J move to the next (right) tab, and K to the previous (left) one?:: What's the difference between insert and passthrough mode?:: They are quite similar, but insert mode has some bindings (like `Ctrl-e` to - open an editor) while passthrough mode only has escape bound. It might also - be useful to rebind escape to something else in passthrough mode only, to be - able to send an escape keypress to the website. + open an editor) while passthrough mode only has shift+escape bound. This is + because shift+escape is unlikely to be a useful binding to be passed to a + webpage. However, any other keys may be assigned to leaving passthrough mode + instead of shift+escape should this be desired. Why does it take longer to open a URL in qutebrowser than in chromium?:: When opening a URL in an existing instance, the normal qutebrowser @@ -260,6 +261,12 @@ Note that there are some missing features which you may run into: . Any greasemonkey API function to do with adding UI elements is not currently supported. That means context menu extentensions and background pages. +How do I change the `WM_CLASS` used by qutebrowser windows?:: + Qt only supports setting `WM_CLASS` globally, which you can do by starting + with `--qt-arg name foo`. Note that all windows are part of the same + qutebrowser instance (unless you use `--temp-basedir` or `--basedir`), so + they all will share the same `WM_CLASS`. + == Troubleshooting Unable to view flash content.:: diff --git a/doc/help/commands.asciidoc b/doc/help/commands.asciidoc index 6149d5247..4e56a6942 100644 --- a/doc/help/commands.asciidoc +++ b/doc/help/commands.asciidoc @@ -165,8 +165,7 @@ If no command is given, show the current binding for the given key. Using :bind * +'command'+: The command to execute, with optional args. ==== optional arguments -* +*-m*+, +*--mode*+: A comma-separated list of modes to bind the key in (default: `normal`). See `:help bindings.commands` for the - available modes. +* +*-m*+, +*--mode*+: The mode to bind the key in (default: `normal`). See `:help bindings.commands` for the available modes. * +*-d*+, +*--default*+: If given, restore a default binding. @@ -1426,7 +1425,7 @@ Unbind a keychain. ==== optional arguments -* +*-m*+, +*--mode*+: A mode to unbind the key in (default: `normal`). See `:help bindings.commands` for the available modes. +* +*-m*+, +*--mode*+: The mode to unbind the key in (default: `normal`). See `:help bindings.commands` for the available modes. [[undo]] @@ -1485,14 +1484,14 @@ Yank something to the clipboard or primary selection. [[zoom]] === zoom -Syntax: +:zoom [*--quiet*] ['zoom']+ +Syntax: +:zoom [*--quiet*] ['level']+ Set the zoom level for the current tab. The zoom can be given as argument or as [count]. If neither is given, the zoom is set to the default zoom. If both are given, use [count]. ==== positional arguments -* +'zoom'+: The zoom percentage to set. +* +'level'+: The zoom percentage to set. ==== optional arguments * +*-q*+, +*--quiet*+: Don't show a zoom level message. diff --git a/doc/help/configuring.asciidoc b/doc/help/configuring.asciidoc index 57e5528c0..b95511245 100644 --- a/doc/help/configuring.asciidoc +++ b/doc/help/configuring.asciidoc @@ -19,10 +19,10 @@ hand, you can simply use those - see <> for details. For more advanced configuration, you can write a `config.py` file - see -<>. As soon as a `config.py` +<>. When a `config.py` exists, the `autoconfig.yml` file **is not read anymore** by default. You need -to <> if you want settings done via -`:set`/`:bind` to still persist. +to <> if you want settings changed via +`:set`/`:bind` to persist between restarts. [[autoconfig]] Configuring qutebrowser via the user interface @@ -89,7 +89,7 @@ You can run `:config-edit` inside qutebrowser to open the file in your editor, The file should be located in the "config" location listed on link:qute://version[], which is typically `~/.config/qutebrowser/config.py` on Linux, `~/.qutebrowser/config.py` on macOS, and -`%APPDATA%/qutebrowser/config.py` on Windows. +`%APPDATA%/qutebrowser/config/config.py` on Windows. Two global objects are pre-defined when running `config.py`: `c` and `config`. @@ -229,18 +229,18 @@ Loading `autoconfig.yml` ~~~~~~~~~~~~~~~~~~~~~~~~ All customization done via the UI (`:set`, `:bind` and `:unbind`) is -stored in the `autoconfig.yml` file, which is not loaded automatically as soon -as a `config.py` exists. If you want those settings to be loaded, you'll need to -explicitly load the `autoconfig.yml` file in your `config.py` by doing: +stored in the `autoconfig.yml` file. When a `config.py` file exists, `autoconfig.yml` +is not loaded automatically. To load `autoconfig.yml` automatically, add the +following snippet to `config.py`: -.config.py: [source,python] ---- config.load_autoconfig() ---- -If you do so at the top of your file, your `config.py` settings will take -precedence as they overwrite the settings done in `autoconfig.yml`. +You can configure which file overrides the other by the location of the above code snippet. +Place the snippet at the top to allow `config.py` to override `autoconfig.yml`. +Place the snippet at the bottom for the opposite effect. Importing other modules ~~~~~~~~~~~~~~~~~~~~~~~ @@ -309,7 +309,7 @@ You can use: import yaml with (config.configdir / 'config.yml').open() as f: - yaml_data = yaml.load(f) + yaml_data = yaml.safe_load(f) for k, v in yaml_data.items(): config.set(k, v) @@ -339,7 +339,7 @@ You can use: import yaml with (config.configdir / 'colors.yml').open() as f: - yaml_data = yaml.load(f) + yaml_data = yaml.safe_load(f) def dict_attrs(obj, path=''): if isinstance(obj, dict): @@ -396,6 +396,7 @@ Pre-built colorschemes - A collection of https://github.com/chriskempson/base16[base16] color-schemes can be found in https://github.com/theova/base16-qutebrowser[base16-qutebrowser] and used with https://github.com/AuditeMarlow/base16-manager[base16-manager]. - Two implementations of the https://github.com/arcticicestudio/nord[Nord] colorscheme for qutebrowser exist: https://github.com/Linuus/nord-qutebrowser[Linuus], https://github.com/KnownAsDon/QuteBrowser-Nord-Theme[KnownAsDon] - https://github.com/evannagle/qutebrowser-dracula-theme[Dracula] +- https://github.com/jjzmajic/qutewal[Pywal theme] Avoiding flake8 errors ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index 91125c2eb..36dedcee4 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -91,6 +91,14 @@ |<>|Color gradient interpolation system for the tab indicator. |<>|Background color of unselected odd tabs. |<>|Foreground color of unselected odd tabs. +|<>|Background color of pinned unselected even tabs. +|<>|Foreground color of pinned unselected even tabs. +|<>|Background color of pinned unselected odd tabs. +|<>|Foreground color of pinned unselected odd tabs. +|<>|Background color of pinned selected even tabs. +|<>|Foreground color of pinned selected even tabs. +|<>|Background color of pinned selected odd tabs. +|<>|Foreground color of pinned selected odd tabs. |<>|Background color of selected even tabs. |<>|Foreground color of selected even tabs. |<>|Background color of selected odd tabs. @@ -215,6 +223,7 @@ |<>|Enter insert mode if an editable element is clicked. |<>|Leave insert mode if a non-editable element is clicked. |<>|Automatically enter insert mode if an editable element is focused after loading the page. +|<>|Leave insert mode when starting a new page load. |<>|Switch to insert mode when clicking flash and other plugins. |<>|Include hyperlinks in the keyboard focus chain when tabbing. |<>|Timeout (in milliseconds) for partially typed key bindings. @@ -261,6 +270,7 @@ |<>|Stack related tabs on top of each other when opened consecutively. |<>|Position of new tabs which are not opened from another tab. |<>|Padding (in pixels) around text for tabs. +|<>|Force pinned tabs to stay at fixed URL. |<>|Shrink pinned tabs down to their contents. |<>|Position of the tab bar. |<>|Which tab to select when the focused tab is removed. @@ -1333,6 +1343,70 @@ Type: <> Default: +pass:[white]+ +[[colors.tabs.pinned.even.bg]] +=== colors.tabs.pinned.even.bg +Background color of pinned unselected even tabs. + +Type: <> + +Default: +pass:[darkseagreen]+ + +[[colors.tabs.pinned.even.fg]] +=== colors.tabs.pinned.even.fg +Foreground color of pinned unselected even tabs. + +Type: <> + +Default: +pass:[white]+ + +[[colors.tabs.pinned.odd.bg]] +=== colors.tabs.pinned.odd.bg +Background color of pinned unselected odd tabs. + +Type: <> + +Default: +pass:[seagreen]+ + +[[colors.tabs.pinned.odd.fg]] +=== colors.tabs.pinned.odd.fg +Foreground color of pinned unselected odd tabs. + +Type: <> + +Default: +pass:[white]+ + +[[colors.tabs.pinned.selected.even.bg]] +=== colors.tabs.pinned.selected.even.bg +Background color of pinned selected even tabs. + +Type: <> + +Default: +pass:[black]+ + +[[colors.tabs.pinned.selected.even.fg]] +=== colors.tabs.pinned.selected.even.fg +Foreground color of pinned selected even tabs. + +Type: <> + +Default: +pass:[white]+ + +[[colors.tabs.pinned.selected.odd.bg]] +=== colors.tabs.pinned.selected.odd.bg +Background color of pinned selected odd tabs. + +Type: <> + +Default: +pass:[black]+ + +[[colors.tabs.pinned.selected.odd.fg]] +=== colors.tabs.pinned.selected.odd.fg +Foreground color of pinned selected odd tabs. + +Type: <> + +Default: +pass:[white]+ + [[colors.tabs.selected.even.bg]] === colors.tabs.selected.even.bg Background color of selected even tabs. @@ -1648,7 +1722,7 @@ Type: <> Default: +pass:[true]+ -This setting is only available with the QtWebKit backend. +On QtWebEngine, this setting requires Qt 5.12 or newer. [[content.frame_flattening]] === content.frame_flattening @@ -2712,6 +2786,17 @@ Type: <> Default: +pass:[false]+ +[[input.insert_mode.leave_on_load]] +=== input.insert_mode.leave_on_load +Leave insert mode when starting a new page load. +Patterns may be unreliable on this setting, and they may match the url you are navigating to, or the URL you are navigating from. + +This setting supports URL patterns. + +Type: <> + +Default: +pass:[true]+ + [[input.insert_mode.plugins]] === input.insert_mode.plugins Switch to insert mode when clicking flash and other plugins. @@ -2962,7 +3047,7 @@ Default: +pass:[false]+ === search.ignore_case When to find text on a page case-insensitively. -Type: <> +Type: <> Valid values: @@ -3309,6 +3394,14 @@ Default: - +pass:[right]+: +pass:[5]+ - +pass:[top]+: +pass:[0]+ +[[tabs.pinned.frozen]] +=== tabs.pinned.frozen +Force pinned tabs to stay at fixed URL. + +Type: <> + +Default: +pass:[true]+ + [[tabs.pinned.shrink]] === tabs.pinned.shrink Shrink pinned tabs down to their contents. @@ -3626,6 +3719,7 @@ Lists with duplicate flags are invalid. Each item is checked against the valid v |FontFamily|A Qt font family. |FormatString|A string with placeholders. |FuzzyUrl|A URL which gets interpreted as search if needed. +|IgnoreCase|Whether to search case insensitively. |Int|Base class for an integer setting. |Key|A name of a key. |List|A list of values. diff --git a/doc/install.asciidoc b/doc/install.asciidoc index 37f6ebb12..c9ae54cd2 100644 --- a/doc/install.asciidoc +++ b/doc/install.asciidoc @@ -102,18 +102,12 @@ $ python3 scripts/asciidoc2html.py On Fedora --------- -NOTE: Fedora's packages used to be outdated for a long time, but are -now (November 2017) maintained and up-to-date again. - qutebrowser is available in the official repositories: ----- # dnf install qutebrowser ----- -However, note that Fedora 25/26 won't be updated to qutebrowser v1.0, so you -might want to <> instead there. - Additional hints ~~~~~~~~~~~~~~~~ diff --git a/icons/qutebrowser.svg b/icons/qutebrowser.svg index 47ef97b75..b26c80c2b 100644 --- a/icons/qutebrowser.svg +++ b/icons/qutebrowser.svg @@ -9,13 +9,13 @@ xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="650.00012" - height="650.00018" - viewBox="0 0 650.0001 650.00015" + width="256" + height="256" + viewBox="0 0 255.99999 255.99999" id="svg4546" version="1.1" - inkscape:version="0.91 r13725" - sodipodi:docname="qutebrowser-logo.svg"> + inkscape:version="0.92.3 (2405546, 2018-03-11)" + sodipodi:docname="qutebrowser.svg"> + transform="translate(522.14287,-1192.7909)">