Compare commits

...

2629 Commits
v1.0.1 ... nsis

Author SHA1 Message Date
Florian Bruhin
179e583af5 NSIS: Remove installation dir if it exists
If we don't do this, when a newer version is installed on top of an older one,
old files which have been deleted persist. In the case of v1.3.3 -> v1.4.0,
this means qutebrowser won't start because of a leftover sip installation which
confuses PyQt 5.11.

This is still potentially dangerous as the user could use e.g. C:\ as
installation path, but we have that issue when uninstalling anyways.
See http://nsis.sourceforge.net/Uninstall_only_installed_files
2018-07-10 14:57:40 +02:00
Florian Bruhin
b9e3d3cab9 Add workaround for chrome-extension:// URLs
Fixes #4049
2018-07-09 12:29:35 +02:00
Florian Bruhin
274b66ec46 Strip trailing newlines from pastebin URL 2018-07-08 22:09:56 +02:00
Florian Bruhin
ae32b79d54 Add exam comments to contributing docs 2018-07-04 15:37:50 +02:00
Florian Bruhin
e80e695a56 Add a mkvenv-pypi-old environment
Fixes #4038
See #3662
2018-07-04 14:08:04 +02:00
Florian Bruhin
0a31e19eda Handle download errors when the reply is already gone
Fixes #1270
2018-07-03 17:16:02 +02:00
Florian Bruhin
0f037fb415 Release v1.4.0 2018-07-03 15:44:44 +02:00
Florian Bruhin
85cc1e4f84 Update changelog for v1.4.0 2018-07-03 15:44:25 +02:00
Florian Bruhin
42a3622906 Ignore a new Qt 5.11 lowlevel message 2018-07-03 15:38:29 +02:00
Florian Bruhin
a0f36c5cbf Skip JS test which is too flaky 2018-07-03 14:15:08 +02:00
Florian Bruhin
dfafab4cff Update changelog 2018-07-03 13:52:50 +02:00
Florian Bruhin
8cf22c85e0 Merge remote-tracking branch 'origin/pr/4019' 2018-07-03 13:52:24 +02:00
Florian Bruhin
4d1e56a8c6 Ignore "Lost UI shared context" error happening on AppVeyor 2018-07-03 13:39:34 +02:00
Florian Bruhin
8c11c516b4 tox: Always allow setting python via envvar 2018-07-03 13:32:53 +02:00
Florian Bruhin
857288b283 Try importing QtWebEngine from AppVeyor 2018-07-03 13:28:18 +02:00
Florian Bruhin
24e93fe023 Remove AppVeyor debugging 2018-07-03 13:27:31 +02:00
Florian Bruhin
8115e109db Update default env in tox.ini 2018-07-03 13:27:18 +02:00
Florian Bruhin
6abe8f2c97 Ignore QtNetwork warning on macOS 2018-07-03 13:22:05 +02:00
Florian Bruhin
7a9183d0b7 Remove 32-bit makensis call
I forgot to remove this in 0af8eec73a
2018-07-03 13:17:15 +02:00
Florian Bruhin
ba362de2c0 Turn on AppVeyor debugging 2018-07-03 13:15:07 +02:00
Florian Bruhin
d03b03f7cb Use Python 3.7 on macOS 2018-07-03 13:13:58 +02:00
Florian Bruhin
7e8c741937 Set compiled=False for BDD Qt comparisons
We often check for bugs and not APIs there.
2018-07-03 13:10:15 +02:00
Florian Bruhin
641f7eb3c5 Don't import test_file on Windows
See https://github.com/pytest-dev/pytest/issues/3650
2018-07-03 13:08:54 +02:00
Florian Bruhin
38791a2386 Only import gen_versioninfo on Windows 2018-07-03 11:38:48 +02:00
Florian Bruhin
b8fb5d4590 Make sure we're using Python 3.6 in release instructions 2018-07-03 11:37:26 +02:00
Florian Bruhin
f65f3db747 appveyor: Make sure we get the Python we want 2018-07-03 11:17:27 +02:00
Florian Bruhin
5add2cd930 Update changelog 2018-07-03 11:15:59 +02:00
Florian Bruhin
0af8eec73a build_release: Remove 32-bit support for Windows
QtWebEngine isn't available for 32-bit anymore:
https://blog.qt.io/blog/2018/05/22/qt-5-11-released/ (comments)
2018-07-03 11:08:56 +02:00
Florian Bruhin
49be92e047 Use 64-bit Python on AppVeyor
QtWebEngine isn't available in the 32-bit build.
2018-07-03 11:06:31 +02:00
Florian Bruhin
ec0bbe67f8 travis: Test with Python 3.7
See https://github.com/travis-ci/travis-ci/issues/9069
2018-07-03 11:00:33 +02:00
Florian Bruhin
e6e28c846f Use PyYAML 3.13b1
It seems to be finished except for a missing wheel we don't need, and it makes
things work on Python 3.7
2018-07-03 10:30:59 +02:00
Florian Bruhin
efc4eb9069 Use PyYAML from git for requirements-tests-git 2018-07-03 10:30:30 +02:00
Florian Bruhin
26d6cf8ef6 Stabilize URL escaping test 2018-07-03 10:29:28 +02:00
Florian Bruhin
05531ddcf0 brew: Update instead of install libyaml 2018-07-03 10:27:38 +02:00
Florian Bruhin
1c8917b10e Remove old brew_install line 2018-07-03 10:27:10 +02:00
pyup-bot
c33c019075 Update py from 1.5.3 to 1.5.4
(cherry picked from commit fa9698564af184e6e7cdddc96c9906442031197e)
2018-07-02 23:26:14 +02:00
pyup-bot
564cd3732b Update py from 1.5.3 to 1.5.4
(cherry picked from commit 2006ad70e88cf5fffec75aa465f968ebba722758)
2018-07-02 23:26:12 +02:00
pyup-bot
1d91a3ac66 Update hypothesis from 3.61.0 to 3.65.0
(cherry picked from commit 98ecc7e77b7dd21037224a4f3b51d0cb654610e6)
2018-07-02 23:26:09 +02:00
Florian Bruhin
f6f713bbfe Skip key forwarding tests on Qt 5.11.1
See #4036
2018-07-02 23:19:57 +02:00
Florian Bruhin
6ca11ed95b Adjust SSL test for Qt 5.11 2018-07-02 23:15:04 +02:00
Florian Bruhin
41303ecfcf Make sure temporary dir exists
This seems to be enforced with Qt 5.12
See #4025
2018-07-02 22:32:59 +02:00
Florian Bruhin
9a14574c9f Skip invalid links on any Qt 5.11 version
See #3661
2018-07-02 22:32:59 +02:00
Florian Bruhin
d861c097b1 Support new dead keys added in Qt 5.11 properly
See https://codereview.qt-project.org/#/c/207231/
2018-07-02 22:32:59 +02:00
Florian Bruhin
77fe2e1c85 Fix test_set_wrong_backend 2018-07-02 22:32:59 +02:00
Florian Bruhin
ad19833e34 Revert "Add workaround for PyQt 5.11 headerDataChanged bug"
PyQt 5.11.1 has already been released, with the bug fixed.

This reverts commit 291763a55643342a6f977ce2a12dcc6f4badbe8a.
2018-07-02 22:32:59 +02:00
Florian Bruhin
eca08f064b Add workaround for PyQt 5.11 headerDataChanged bug
https://www.riverbankcomputing.com/pipermail/pyqt/2018-June/040445.html
2018-07-02 22:32:59 +02:00
Florian Bruhin
c3455d9082 Add a wrapper around sip
Starting with PyQt 5.11, the sip module now is bundled with PyQt as PyQt.sip.
Having a qutebrowser.qt also helps with #3625, see #995
2018-07-02 22:32:59 +02:00
Florian Bruhin
f7ae7e7d40 Update for PyQt 5.11 2018-07-02 22:32:59 +02:00
Florian Bruhin
e857400c2c Add missing str() 2018-06-28 13:26:45 +02:00
Florian Bruhin
dbd4ce48e6 Downgrade and filter PyYAML 4.1
This reverts commit 96defc5dc2.

With PyYAML 4.1 we don't have C extensions on Travis CI:
https://github.com/yaml/pyyaml/issues/179
https://github.com/yaml/pyyaml/issues/182

Unfortunately, cython isn't in the APT whitelist either:
https://github.com/travis-ci/apt-source-whitelist/issues/37
2018-06-28 11:46:03 +02:00
Florian Bruhin
a7af5195d1 Set title when showing PDF.js error page
Fixes #3894
2018-06-28 11:22:44 +02:00
Florian Bruhin
e9c78b29ed Ignore Python 3.7 collections.abc warning
Related issues/PRs:
https://github.com/yaml/pyyaml/pull/181
https://github.com/pypa/setuptools/issues/1401
https://github.com/pallets/markupsafe/pull/98
https://github.com/yaml/pyyaml/pull/181
https://github.com/pallets/jinja/pull/867
2018-06-27 16:01:21 +02:00
Florian Bruhin
96defc5dc2 Update PyYAML to 4.1 2018-06-27 15:53:58 +02:00
Florian Bruhin
a804300dc0 Add missing tests for spell.init() 2018-06-26 16:56:22 +02:00
Florian Bruhin
2f612aa6df Update comment 2018-06-26 15:54:56 +02:00
Florian Bruhin
aed964d9f5 Update changelog 2018-06-26 10:41:21 +02:00
Florian Bruhin
8519aa940f Decorate slots properly 2018-06-26 10:40:13 +02:00
Florian Bruhin
ea4ee6f00b Use the url_changed signal in the tab API 2018-06-26 10:39:33 +02:00
Florian Bruhin
1536843f33 Only get greasemonkey object once 2018-06-26 10:39:04 +02:00
Florian Bruhin
61da5d0c7c Merge remote-tracking branch 'origin/pr/4017' 2018-06-26 10:37:17 +02:00
Florian Bruhin
3312c221c4 Stabilize ssl_strict test 2018-06-26 10:26:17 +02:00
Florian Bruhin
85a9f6a08a Fix lint 2018-06-26 10:23:48 +02:00
Jimmy
c43d173197 greasemonkey: s/userscripts/greasemonkey_scripts/
No need to confuse developers as well as users.
2018-06-26 16:42:31 +12:00
Jimmy
ee2c765859 greasemonkey: check _widget is not deleted
Just for good luck.

No crash has been reported here but it is a common pattern for functions
called from signals.
2018-06-26 16:42:31 +12:00
Jimmy
6f1232e621 greasemonkey: move 5.7.1 injection method into _WebEngineScripts
Moves the 5.8 check to `_WebEngineScripts.init()`.

Changes `_inject_userscripts` to allow for the two code paths. With
5.7.1 we need to specify the injection point and not clear all scripts
for each call, since we have to call it three times.

Change the 5.8+ hook to call a new method which passes all the scripts
into `_inject_userscripts` so that doesn't have to have a fallback
conditional inside it because thats an inversion of responsibility!

Pulling the remove scripts part into a seperate function and making it
the callers responsibilty to call that first would tidy it up a little
more but meh.

I was worried about just doing `_widget.page().urlChanged.connect()`
once at tab init, where before it was connected at page init, because I
was under the impression that the child page can be replaced at any
time, eg when navigating to a new origin. But under manual testing I
didn't see that at all. Maybe I was mistaken or maybe that only started
in a later Qt version.
2018-06-26 16:42:31 +12:00
Jimmy
324966cfe7 greasemonkey: also support qute-js-world on 5.7.1
A straight copy from webengintab.

Yes I know I shouldn't be importing a private thing from webenginetab,
I'm working on refactoring now.
2018-06-26 15:00:35 +12:00
Jimmy
521268a1f7 Update comment. 2018-06-26 15:00:35 +12:00
Jimmy
54ca9b34e5 greasemonkey: enable running in isolated js worlds
QtWebEngine (via chromium) has the ability to run injected scripts in
isolated "worlds". What is isolated is just the javascript environment,
so variables and functions defined by the page and the script won't
clobber each other, or be able to interact (including variables saved to
the global `window` object). The DOM is still accessible from "isolated"
scripts.

This is NOT a security measure. You cannot put untrusted scripts in one
of these isolated worlds and expect it to not be able to do whatever
page js can do, it is just for namespacing convenience. See
https://stackoverflow.com/questions/9515704/insert-code-into-the-page-context-using-a-content-script
for some examples of how to inject scripts into the page scope using DOM
elements.

Now you can specify the world ID in a `@qute-js-world` directive like:

```
// ==UserScript==
// @name         Do thing
// @match        *://some.site/*
// @qute-js-world 1234
// ==/UserScript==
document.body.innerHTML = "<strong>overwritten</strong>"
```

The QtWebEngine docs say worldid is a `quint32` so you can put whatever
number (positive, whole, real) you want there. I have chosen to allow
the `qutebrowser.utils.usertypes` enum as aliases for IDs that are
predefined in
`qutebrowser.browser.webengine.webenginetab._JS_WORLD_MAP`. So you can
pass `main`, `application`, `user` or `jseval` in there too. `main` (0)
is the default one and is the only one in which JS disabled when
`content.javascript.enabled` is set to `false`. All others are still
enabled.

I'm not sure whether using any of those already-named worlds makes
sense, apart from `main`. We could stop people from using them I
suppose. Another option is to allow people to pass in `*` as a value to
have scripts put into their own little worlds, probably backed by a
counter in the GreaseMonkeyManager class.

Chrome docs: https://developer.chrome.com/extensions/content_scripts#execution-environment
Webengine docs: https://doc.qt.io/qt-5/qwebenginescript.html#details
2018-06-26 15:00:35 +12:00
Florian Bruhin
1bc3d444b6 Stabilize escaping URLs test 2018-06-25 23:02:50 +02:00
Florian Bruhin
876aa5a9b1 Fix lint 2018-06-25 22:51:55 +02:00
Florian Bruhin
87778277e0 Fix SSL error page tests 2018-06-25 22:51:48 +02:00
Florian Bruhin
81b3ef937e Move handling of certificate errors to webenginetab 2018-06-25 21:04:32 +02:00
Florian Bruhin
8a4bba11ed Disable certificate workaround on Qt >= 5.9
Fixes #4020
2018-06-25 20:35:48 +02:00
Florian Bruhin
3f923b41e0 Revert "Update pyqt5 from 5.10.1 to 5.11.1"
This reverts commit 1f19db0785.
2018-06-25 20:08:50 +02:00
Florian Bruhin
158ccd7d54 Revert "Update pyqt5 from 5.10 to 5.11.1"
This reverts commit e1bc5389a2.
2018-06-25 20:08:42 +02:00
Florian Bruhin
228ca732d5 Merge remote-tracking branch 'origin/pyup-scheduled-update-2018-06-25' 2018-06-25 20:08:24 +02:00
pyup-bot
b3790f7a7e Update pytest from 3.6.1 to 3.6.2 2018-06-25 19:21:17 +02:00
pyup-bot
d6554a131e Update hypothesis from 3.59.1 to 3.61.0 2018-06-25 19:21:15 +02:00
pyup-bot
1f19db0785 Update pyqt5 from 5.10.1 to 5.11.1 2018-06-25 19:21:14 +02:00
pyup-bot
e1bc5389a2 Update pyqt5 from 5.10 to 5.11.1 2018-06-25 19:21:12 +02:00
Jay Kamat
da0a6305df Fix crash when tab is closed after a per-domain forced reload 2018-06-25 12:45:17 -04:00
Florian Bruhin
6c9e23af4a eslint: Turn off max-lines-per-function 2018-06-25 08:14:02 +02:00
Florian Bruhin
13f765a000 Fix changelog formatting 2018-06-24 22:33:46 +02:00
Florian Bruhin
fc19262eaa Fix test_shared.py 2018-06-24 22:31:27 +02:00
Florian Bruhin
f2f481d991 Support URL patterns for permissions and ssl_strict
See #3636
2018-06-24 21:38:37 +02:00
Florian Bruhin
f5e69b2174 Show inspector after creating it 2018-06-24 19:57:52 +02:00
Florian Bruhin
e6e844b039 Support URL patterns for content.headers settings
See #3636
2018-06-24 19:54:24 +02:00
Florian Bruhin
a02c25dfb1 Don't escape URLs for qute://history
We only use the URL to set a 'href' attribute, which does not need escaping.

See #4011
Fixes #4012
2018-06-23 14:27:07 +02:00
Florian Bruhin
d2254ca48b Release v1.3.3
(cherry picked from commit ad9b50601c)
2018-06-21 23:32:56 +02:00
Florian Bruhin
66fc3a30dd Update changelog 2018-06-21 23:30:27 +02:00
Florian Bruhin
0864ad4069 Fix shadowing of 'html' name 2018-06-21 22:28:27 +02:00
Florian Bruhin
9a5439e5d0 Re-add waiting for QQuickWidget
Apparently this is still needed on some PyQt versions.
2018-06-21 22:22:04 +02:00
Florian Bruhin
7a7e04a054 Move fix to v1.3.3 in changelog 2018-06-21 21:42:44 +02:00
Florian Bruhin
d961eab1d2 Update changelog for v1.3.3 2018-06-21 21:42:08 +02:00
Florian Bruhin
5a7869f2fe Fix XSS issue on qute://history
Fixes #4011
2018-06-21 21:20:19 +02:00
Florian Bruhin
62d8b5b574 Don't depend on PyQt5.QtQuickWidgets to get RWHV
Some distributions (at least FreeBSD) don't package that module, so let's not
rely on it.
2018-06-21 17:14:29 +02:00
Florian Bruhin
c87757a913 Revert "Properly add QtQuickWidgets dependency"
Looks like FreeBSD doesn't have QtQuickWidgets packaged at all, so let's do the
same without requiring it...

This reverts commit e5405f0ae9.
2018-06-21 16:35:29 +02:00
Florian Bruhin
9f5ca475c9 Don't try to set focus if prev_focus is None 2018-06-21 01:44:15 +02:00
Florian Bruhin
e7a300865c Fix lint 2018-06-21 01:43:09 +02:00
Florian Bruhin
4887385bdd Fix test_dictionary_dir 2018-06-21 01:40:36 +02:00
Florian Bruhin
1000a1eac2 Merge remote-tracking branch 'origin/pr/4005' 2018-06-21 01:01:27 +02:00
Florian Bruhin
e5405f0ae9 Properly add QtQuickWidgets dependency 2018-06-21 00:21:52 +02:00
pyup-bot
a73a778b9d Update pytest-qt from 2.4.0 to 2.4.1 2018-06-18 19:11:20 +02:00
pyup-bot
7c4eaa80b0 Update hypothesis from 3.57.0 to 3.59.1 2018-06-18 19:11:19 +02:00
pyup-bot
c3b76d1d01 Update cheroot from 6.3.1 to 6.3.2 2018-06-18 19:11:17 +02:00
pyup-bot
fa0e8c1b51 Update requests from 2.18.4 to 2.19.1 2018-06-18 19:11:16 +02:00
pyup-bot
da8f76d082 Update requests from 2.18.4 to 2.19.1 2018-06-18 19:11:14 +02:00
pyup-bot
91c0aae05b Update requests from 2.18.4 to 2.19.1 2018-06-18 19:11:13 +02:00
Florian Bruhin
3399f2df96 Always clear searches between page loads
Looks like this wasn't properly fixed in Qt for some reason.
Fixes #3693
See #2728 and bef372e5f5
2018-06-17 21:03:44 +02:00
Florian Bruhin
2029f52fdc Show cause when ~/.netrc can't be read 2018-06-17 20:53:29 +02:00
Florian Bruhin
663d1a4d2f Read dictionaries from /usr/share/qt on Qt >= 5.10
Fixes #3759
Supersedes #3762
See #2939, #4003
2018-06-17 20:27:52 +02:00
Florian Bruhin
7b7e0c93f5 Update Chromium version in changelog 2018-06-16 11:54:53 +02:00
Florian Bruhin
e2ef39e872 Add Comment to .desktop file 2018-06-14 23:29:16 +02:00
Florian Bruhin
7654467f36 Remove unused import 2018-06-14 17:43:20 +02:00
Florian Bruhin
b1b06fcb43 Fix restore test 2018-06-14 17:42:33 +02:00
Florian Bruhin
746c2986f0 Fix test_stylesheet on Qt 5.11 2018-06-14 16:42:24 +02:00
Florian Bruhin
f4386fa9ea Update changelog 2018-06-14 16:35:16 +02:00
Florian Bruhin
07cf2f5b60 Unconditionally restore mode after prompt 2018-06-14 16:09:30 +02:00
Florian Bruhin
4dddc07753 Make sure modeman.enter(KeyMode.normal) does something sensible 2018-06-14 16:09:26 +02:00
Florian Bruhin
11fce30ed0 Stabilize mode_on_change tests 2018-06-14 15:56:48 +02:00
Florian Bruhin
1335fccba1 Merge remote-tracking branch 'origin/pr/3590' into tab-mode 2018-06-14 15:40:58 +02:00
Florian Bruhin
e4e982c0a7 Remove unused variable 2018-06-14 14:58:07 +02:00
Florian Bruhin
7592186181 Update changelog 2018-06-14 14:58:07 +02:00
Florian Bruhin
868cd115be Remove old focus handling code 2018-06-14 14:58:07 +02:00
Florian Bruhin
cec63ea449 Merge remote-tracking branch 'origin/pr/3906' 2018-06-14 14:49:30 +02:00
Jay Kamat
e5b6552568 Clean up and simplify some logic 2018-06-13 15:37:32 -07:00
Florian Bruhin
a0adee55c9 Quit hard on ignored exceptions
We can't realistically shut down cleanly because we most likely haven't init'ed
properly yet.

Fixes #3993
2018-06-13 21:13:39 +02:00
Florian Bruhin
389c1d11a0 Merge remote-tracking branch 'origin/pr/3990' 2018-06-13 20:28:08 +02:00
Florian Bruhin
b67733b781 Use ImportError for winreg import
This also satisfies pylint.
2018-06-13 20:15:16 +02:00
Florian Bruhin
bcc4bd22ee Merge remote-tracking branch 'origin/pr/3991' 2018-06-13 20:15:06 +02:00
Florian Bruhin
cb2881e0d7 Use info loglevel for :debug-cache-stats
Closes #3994
2018-06-13 19:10:01 +02:00
Florian Bruhin
1541088e76 Use -webkit-filter on old Qt 2018-06-12 17:01:34 +02:00
Florian Bruhin
5435609552 Update changelog 2018-06-12 16:50:32 +02:00
Florian Bruhin
c37134861e Use ES6 template strings 2018-06-12 16:49:54 +02:00
Florian Bruhin
772654bcae Use calculated background color for newer Qt versions 2018-06-12 16:46:03 +02:00
Florian Bruhin
68a7387b6b Merge remote-tracking branch 'origin/pr/3940' 2018-06-12 16:32:05 +02:00
Florian Bruhin
fd4ae2fabe Fix test_set_wrong_backend 2018-06-12 14:17:50 +02:00
Florian Bruhin
a1a5885367 Set parents for tab sub-objects 2018-06-12 14:09:06 +02:00
Florian Bruhin
a6db700886 Fix HTML5 fullscreen 2018-06-12 13:44:47 +02:00
Florian Bruhin
d5dcec4320 Add changelog entry for Qt update 2018-06-12 13:44:41 +02:00
Slackhead
088c7b235d fix for qt 5.7.1 2018-06-12 11:22:41 +01:00
Florian Bruhin
6faff11243 Improve error messages with backend conditionals 2018-06-12 11:10:03 +02:00
Florian Bruhin
2f97a597a4 travis: Run coverage with PyQt 5.10 2018-06-12 10:53:34 +02:00
Florian Bruhin
e066f83a7c Make configinit tests run with all setups 2018-06-12 10:52:22 +02:00
Florian Bruhin
5b5657b0d5 Make sure debug_flags is available for unit tests 2018-06-12 10:38:19 +02:00
Florian Bruhin
3b0c8e46a3 Add an initial cookie filter for Qt 5.11
See #3010
2018-06-12 09:36:05 +02:00
Slackhead
35a1e118f8 combine style nodes 2018-06-12 04:25:13 +01:00
Florian Bruhin
093f07f552 Add content.canvas_reading setting
See #2377
Closes #2235
2018-06-11 23:28:04 +02:00
bitraid
b61c99687d build_release.py: reformat 2018-06-12 00:27:43 +03:00
Florian Bruhin
ad7e080827 Fix lint 2018-06-11 21:47:38 +02:00
Florian Bruhin
67c67db230 Handle multiple visible children when finding lost focusProxy
When we click a QTBUG link (to open in a new tab) from Qt's codereview, we get
two RWHV objects which both are visible.

Experimenting with .setEnabled(False) it looks like it's (hopefully always...)
the last one which is the one to use.
2018-06-11 21:43:27 +02:00
Florian Bruhin
c328d54ebe Add a lost-focusproxy debug flag 2018-06-11 21:27:08 +02:00
Florian Bruhin
a6b314ae91 Don't connect Qt 5.11 signals on PyQt 5.10
Apparently the signal attributes already exist with PyQt 5.10 (*sigh*) but PyQt
doesn't know what to do with the arguments, causing this to happen:

TypeError: unable to convert a C++ 'QWebEngineRegisterProtocolHandlerRequest'
instance to a Python object
2018-06-11 21:21:41 +02:00
Florian Bruhin
d42934af08 Turn off FocusOnNavigationEnabled on Qt 5.9
This way we get the same behavior with Qt 5.9 and 5.10 at least, leaving only
5.7 if we pretend that 5.8 never existed.
2018-06-11 20:28:00 +02:00
Florian Bruhin
e7659cea63 Update changelog 2018-06-11 20:24:00 +02:00
Florian Bruhin
141afff0c6 Add a content.desktop_capture setting
See #2939
2018-06-11 20:18:57 +02:00
bitraid
ddfbe255e7 build_release.py: Get python path from registry on Windows 2018-06-11 20:45:35 +03:00
Florian Bruhin
69abc9a1a1 Add a content.webrtc_public_interfaces_only option
See #3010
Fixes #2163
2018-06-11 19:44:45 +02:00
Florian Bruhin
3bf89bcea4 Add content.autoplay option
See #3010
Closes #1643
2018-06-11 19:32:34 +02:00
Florian Bruhin
c5b7ed350e Make it possible to provide a converter for websettings 2018-06-11 19:14:31 +02:00
pyup-bot
a5447e0e94 Update vulture from 0.26 to 0.27 2018-06-11 19:06:46 +02:00
pyup-bot
4d026bde6f Update vulture from 0.26 to 0.27 2018-06-11 19:06:39 +02:00
pyup-bot
6943677a90 Update pytest from 3.6.0 to 3.6.1 2018-06-11 19:06:37 +02:00
pyup-bot
37d3cf1e9c Update pylint from 1.9.1 to 1.9.2 2018-06-11 19:06:36 +02:00
pyup-bot
21dba1ffda Update astroid from 1.6.4 to 1.6.5 2018-06-11 19:06:34 +02:00
pyup-bot
82a0c94573 Update idna from 2.6 to 2.7 2018-06-11 19:06:33 +02:00
pyup-bot
72f0820204 Update idna from 2.6 to 2.7 2018-06-11 19:06:31 +02:00
pyup-bot
33ba47797d Update idna from 2.6 to 2.7 2018-06-11 19:06:30 +02:00
Florian Bruhin
b7c1d7fe37 Fix broken tests 2018-06-11 18:38:22 +02:00
Florian Bruhin
263d298449 Remove the content.developer_extras setting 2018-06-11 18:09:24 +02:00
Florian Bruhin
e5fbb9f68a Remove pyqtSlot annotations for new types 2018-06-11 18:09:24 +02:00
Florian Bruhin
54011782c8 webenginetab: Move scripts to separate object 2018-06-11 18:09:24 +02:00
Florian Bruhin
b3749df009 webenginetab: Move permissions to separate object 2018-06-11 18:09:18 +02:00
Florian Bruhin
4186577928 Add support for navigator.registerProtocolHandler
See #3010
2018-06-11 18:09:18 +02:00
Florian Bruhin
c020160f75 Add support for navigator.webkitPersistentStorage.requestQuota
See #3010
2018-06-11 18:09:18 +02:00
Florian Bruhin
4ea957b68b Allow Qt 5.11 for backends in configdata.yml 2018-06-11 18:09:18 +02:00
Florian Bruhin
05e73872b6 Add blocking=True to shared.feature_permission 2018-06-11 16:37:53 +02:00
Florian Bruhin
be95d6f505 Remove moved audio API 2018-06-11 16:07:32 +02:00
Florian Bruhin
b954fd4b15 Move _on_feature_permission_requested to WebEngineTab 2018-06-11 16:06:58 +02:00
Florian Bruhin
6e90465cdd Update docs 2018-06-11 15:38:01 +02:00
Florian Bruhin
98c82859b5 Skip "History with view-source URL" on QtWebKit 2018-06-11 15:36:48 +02:00
Florian Bruhin
8964845c18 Remove unused import 2018-06-11 15:30:01 +02:00
Florian Bruhin
c7f57bc111 Tell pylint to shut up about a shadowed argument 2018-06-11 15:29:35 +02:00
Florian Bruhin
09a5ef8140 pylint: Ignore ImportError for windows-specific import 2018-06-11 15:22:34 +02:00
Florian Bruhin
9f5a5a12ba Break long line 2018-06-11 15:22:12 +02:00
Florian Bruhin
f052eff038 Stop using view-source: scheme for Pygments-highlighted URLs
Doing so causes QtWebEngine to load its own view-source: page even if we supply
custom data.

Instead we pass the original page's URL (to not regress #2948).

This partially reverts #3521 and reintroduces TabData.viewing_source.

However, on QtWebEngine we can still ":view-source --pygments" and then
":view-source" (with or without "--pygments") again, because the bit gets
cleaned in _on_load_started.

See #3654.
2018-06-11 15:18:00 +02:00
Florian Bruhin
6e23a6b958 Merge remote-tracking branch 'origin/pr/3654' 2018-06-11 14:56:32 +02:00
Florian Bruhin
cbd9e36e0f Fix typo 2018-06-11 14:13:11 +02:00
Florian Bruhin
12a7aaed95 flake8: Don't require docstrings for stuff under tests/ 2018-06-11 14:12:47 +02:00
Florian Bruhin
2b0e89ab14 Update changelog 2018-06-11 14:01:42 +02:00
Florian Bruhin
b63e06561d Only consider visible render widgets for lost focusProxy
Otherwise, when commenting out the focusProxy way above, and using "foo !npm"
with DuckDuckGo, we get two children (one visible, one invisible).
2018-06-11 14:00:02 +02:00
Florian Bruhin
49b6a512c2 Add missing docstring 2018-06-11 13:17:14 +02:00
Florian Bruhin
8949afc2bf Reformat and document gen_versioninfo 2018-06-11 13:13:58 +02:00
Florian Bruhin
e6dd05a2c7 Merge remote-tracking branch 'origin/pr/3857' 2018-06-11 13:08:29 +02:00
Florian Bruhin
b5d1614c48 Add audio attribute to FakeWebTab 2018-06-11 12:41:55 +02:00
Florian Bruhin
bfae6b357a Update changelog 2018-06-11 12:39:47 +02:00
Florian Bruhin
4dcba2343d Add expected_names to test arguments 2018-06-11 12:37:48 +02:00
Florian Bruhin
e36b6b13e0 Edit docstring :D 2018-06-11 12:35:49 +02:00
Florian Bruhin
2934f4a1ca Merge remote-tracking branch 'origin/pr/3973' 2018-06-11 12:34:18 +02:00
Florian Bruhin
8376278961 Update docs 2018-06-11 12:14:24 +02:00
Florian Bruhin
a1fcdbcfd1 Move muted/audible API to own ".audio" object 2018-06-11 12:12:37 +02:00
Florian Bruhin
1c8d470bd7 Merge remote-tracking branch 'origin/pr/3908' 2018-06-11 12:06:09 +02:00
Jimmy
b7929ef747 Add tests for suppressing debug log records.
For the LogFilter tests I just copied some of the examples that were
already being used and reversed them. To do that without even more
duplication I had to add another parameter to the test.
2018-06-11 21:56:59 +12:00
Florian Bruhin
c08c740793 Update changelog 2018-06-11 11:45:31 +02:00
Florian Bruhin
649c9f37cd Fix import 2018-06-11 11:35:37 +02:00
Florian Bruhin
3999802c71 Add missing 'return' 2018-06-11 11:35:35 +02:00
Florian Bruhin
cf8dbd8bfd Move pressing Enter into a method 2018-06-11 11:35:16 +02:00
Florian Bruhin
7f69920158 Merge remote-tracking branch 'origin/pr/3947' 2018-06-11 11:29:14 +02:00
Jimmy
addd2e74ce Allow negating categories in --logfilter
Sometimes I want to see all the logs _except_ for the sql stuff and
"marked cookies as dirty". with this you should be able to pass
`--logfilter \!sql,save`.
2018-06-11 21:26:54 +12:00
Florian Bruhin
f034abe6a1 Handle showing/hiding of the inspector properly 2018-06-11 11:07:14 +02:00
Florian Bruhin
1ba2e3e24b Implement Qt 5.11 devtools support
See #3010
2018-06-11 11:07:14 +02:00
Jay Kamat
315ed519ee Use ctrl-enter in all cases 2018-06-10 16:27:56 -07:00
Florian Bruhin
20763a87c0 Update changelog 2018-06-10 17:34:17 +02:00
Florian Bruhin
c4add62301 Merge remote-tracking branch 'origin/pr/3825' 2018-06-10 17:30:44 +02:00
Florian Bruhin
50fa7743ba Only use OS-specific line separator for hints 2018-06-10 17:21:31 +02:00
Florian Bruhin
3bffe1ccf8 Release v1.3.2 2018-06-10 15:59:50 +02:00
Florian Bruhin
bd26498f6e Update changelog for v1.3.2
[ci skip]
2018-06-10 15:57:10 +02:00
Florian Bruhin
829a6855a3 Make sure test_env_vars restores variables correctly
Otherwise, we'd get a segfault inside Qt in test_stylesheet, since
88f2873a79.
2018-06-10 15:49:24 +02:00
Florian Bruhin
ca8d3903e3 Improve configinit tests 2018-06-10 10:49:26 +02:00
Jay Kamat
11d8df0e3e Simplify logic and resolve style issues 2018-06-09 16:45:42 -07:00
bitraid
00199ae60e Corrections to gen_versioninfo.py script
- Use main() function
- Call utils.change_cwd()
- Import info text
- Don't use fstrings
2018-06-10 02:24:47 +03:00
Jay Kamat
de127497a2 Press enter to follow links instead of using js
This codepath may trigger a crash which was fixed by
0e75f3272d.
However, this commit does not make it more likely to happen, and this
patch was backported into arch (at least).

In the future, we may be able to use <enter> on qtwebkit with js,
without triggering this crash
2018-06-09 15:42:44 -07:00
Florian Bruhin
292d92d02e Update changelog 2018-06-09 23:01:29 +02:00
Florian Bruhin
c9fddfe458 Fix lint 2018-06-09 23:00:57 +02:00
Florian Bruhin
7fdeeb25b7 Merge remote-tracking branch 'origin/pr/3793' 2018-06-09 22:59:52 +02:00
Florian Bruhin
6022fd2b26 Document how to run a qutebrowser development build
Fixes #3795
Supersedes #3798
2018-06-09 21:56:56 +02:00
Florian Bruhin
1d19a2ebbb Fix typo 2018-06-09 21:54:32 +02:00
Florian Bruhin
7d11c3aa43 Update changelog 2018-06-09 21:32:09 +02:00
Florian Bruhin
96739d0013 Merge remote-tracking branch 'origin/pr/3864' 2018-06-09 21:29:15 +02:00
Florian Bruhin
dcb1191f93 Remove the deprecated :tab-detach 2018-06-09 21:25:09 +02:00
Florian Bruhin
cf3c200fcb Update changelog 2018-06-09 20:50:35 +02:00
Florian Bruhin
a663c857cc Merge remote-tracking branch 'origin/pr/3926' 2018-06-09 20:50:17 +02:00
Slackhead
c3771ca2b2 double quoted and className corrected 2018-06-09 19:45:48 +01:00
Florian Bruhin
c73cb7efad Update changelog 2018-06-09 20:40:57 +02:00
Florian Bruhin
22f05e3ca5 Merge remote-tracking branch 'origin/pr/3929' 2018-06-09 20:40:32 +02:00
Florian Bruhin
9161aa6e17 Merge remote-tracking branch 'origin/pr/3930' 2018-06-09 20:36:28 +02:00
Florian Bruhin
313cc42d8a Link to code.qt.io instead of GitHub for _chromium_version 2018-06-09 20:26:12 +02:00
Florian Bruhin
d486a056e7 Update docs 2018-06-09 20:20:46 +02:00
Florian Bruhin
7ce7176475 Fix lint 2018-06-09 20:20:08 +02:00
Florian Bruhin
1b48b67443 Rename reporter.escape_quits to input.escape_quits_reporter 2018-06-09 20:19:32 +02:00
Florian Bruhin
486a92a710 Merge remote-tracking branch 'origin/pr/3944' 2018-06-09 20:18:25 +02:00
Florian Bruhin
ec88c15390 Fix waiting for initial focus object with Qt 5.11 workarounds
This was broken in d32d541ac0 because now
apparently PyQt knows it's a QQuickWidget.
2018-06-09 20:05:26 +02:00
Florian Bruhin
40b1be6925 Fix test_disable_gpu with QtWebKit 2018-06-09 19:59:11 +02:00
Florian Bruhin
41b5fca9b7 Add additional test 2018-06-09 19:57:22 +02:00
Florian Bruhin
b0325e17b7 Add a YamlConfig._migrate_bool helper 2018-06-09 19:57:11 +02:00
Florian Bruhin
7949335a2b Remove unused import 2018-06-09 19:51:05 +02:00
Florian Bruhin
6e954a1596 Allow to force software rendering with wayland on Qt 5.11
Closes #2932 (hopefully for the last time)
2018-06-09 16:50:48 +02:00
Florian Bruhin
88f2873a79 Allow more values for the qt.force_software_rendering setting 2018-06-09 16:21:10 +02:00
Jay Kamat
5d38d28fee Fix incorrect usage of tab_id 2018-06-08 20:59:25 -07:00
Florian Bruhin
d32d541ac0 Further simplify getting focusProxy children 2018-06-08 17:10:47 +02:00
Florian Bruhin
cc497bf2ea Improve RWHV typecheck for focusProxy 2018-06-08 15:13:48 +02:00
Florian Bruhin
9725d9ce33 Exclude QMenu when trying to find the missing focusProxy 2018-06-08 14:55:34 +02:00
Florian Bruhin
1531961aeb Show children in focusProxy workaround 2018-06-08 14:40:59 +02:00
Florian Bruhin
4e6fede40d Update changelog 2018-06-08 08:56:17 +02:00
Florian Bruhin
91b4106dcf Fix check for reloads on Qt < 5.11
This was broken in 6ccd69dad2
2018-06-08 08:53:10 +02:00
Florian Bruhin
a13618fe2a Merge branch 'pyup-scheduled-update-2018-06-04' 2018-06-07 22:57:48 +02:00
Florian Bruhin
8bf7cb539a Mark modal window test as flaky 2018-06-07 22:57:16 +02:00
Florian Bruhin
d96a98a058 Mention other colorschemes as well 2018-06-07 20:31:27 +02:00
Florian Bruhin
5e6002fcdc Merge remote-tracking branch 'origin/pr/3963' 2018-06-07 20:25:24 +02:00
Florian Bruhin
11b957f24b tests: Adjust getting markers for pytest 3.6 2018-06-07 19:29:01 +02:00
Florian Bruhin
4614ad5063 Remove unused import 2018-06-07 18:01:29 +02:00
Florian Bruhin
6e48648033 Update changelog 2018-06-07 17:52:46 +02:00
Florian Bruhin
d541634a7c Avoid hacks for changing per-domain settings on Qt 5.11.1 2018-06-07 17:51:21 +02:00
Florian Bruhin
b1506274c5 Implement a better workaround for chrome-error:// URLs
It looks like chrome-error://chromewebdata/ triggers another invalid scheme
load which is why the endless loop happens. When we install a custom scheme
handler for chrome-error:// we can at least show an error page.
2018-06-07 16:03:25 +02:00
Florian Bruhin
c6a1d729f4 Update the list of chrome:// URLs
See #3010
2018-06-07 15:42:58 +02:00
Florian Bruhin
596041c40e Go back to using an invalid scheme for invalid_link.html
Otherwise, this breaks the tests on Qt 5.10
2018-06-07 15:30:28 +02:00
Florian Bruhin
9b795c5257 Update changelog 2018-06-07 14:35:09 +02:00
Florian Bruhin
89f4333df1 Make sure external schemes are clickable via hints
This issue was probably introduced in 545539f28d
- with JavaScript, we can't "click" on an external link.

There might be a better solution using
QWebEngineSettings::setUnknownUrlSchemePolicy(QWebEngineSettings::AllowAllUnknownUrlSchemes)
temporarily when using hints with PyQt 5.11.

Fixes #2833
2018-06-07 14:33:49 +02:00
Florian Bruhin
59e5a2a6f1 Update changelog
See #3661
2018-06-07 13:49:39 +02:00
Florian Bruhin
0c0d204fd4 Add a workaround for chrome-error:// loops on Qt 5.11
See #3661
2018-06-07 13:49:33 +02:00
Florian Bruhin
999513d5d8 Skip invalid link tests on Qt 5.11
Qt 5.11 just loads about:blank and doesn't let us catch this in
acceptNavigationRequest, but the same happens in Chromium as well.

See #3661
2018-06-07 13:49:28 +02:00
Florian Bruhin
d059197bc9 Use a valid scheme in invalid_link.html
This is to avoid triggering QTBUG-63378 which fails differently with a custom
scheme.

See #3661
2018-06-07 13:49:22 +02:00
Florian Bruhin
0e9159e8e8 Revert "Fix Qt 5.11 issues with clicking invalid links"
This reverts commit 1956590df84a72c7f9a516e805d01529291fccf8.

Turns out the actual issue wasn't due to *invalid* links - it's with links
which have an unknown scheme.

There's still a change in behavior between Qt 5.10 and 5.11 though: Invalid
links are apparently not passed to acceptNavigationRequest (sometimes?) so we
don't show an error message. Instead, we just load about:blank. However,
Chromium does that too and we can't handle a real click easily, so let's just
ignore that one.

See #3661
2018-06-07 13:49:13 +02:00
Florian Bruhin
3d53d0d2c5 Fix Qt 5.11 issues with clicking invalid links
See #3661
2018-06-07 13:48:04 +02:00
Florian Bruhin
eb6478dd3e Reenable Qt 5.11 tests on Travis
Fixes #3661
2018-06-07 13:48:04 +02:00
Florian Bruhin
8cc3804119 Don't run test with failed download on Qt 5.11
Looks like we can't use an <a> tag with download-attribute to trigger a failed
download in the test on Qt 5.11...

See #2298, #3661
2018-06-06 21:12:23 +02:00
Florian Bruhin
513591348c Update changelog 2018-06-06 20:26:12 +02:00
Florian Bruhin
456fdc55cc Only set PseudoLayout with Qt 5.11 2018-06-06 20:26:12 +02:00
Florian Bruhin
7e31897dcc Fix lint 2018-06-06 20:26:12 +02:00
Florian Bruhin
5147fc832c Handle resizing via PseudoLayout
This fixes the scenario where we just get a grey view when opening a link in a
tab from DuckDuckGo.
2018-06-06 20:26:12 +02:00
Florian Bruhin
ec6c5ebb69 Try harder to get the RenderWidgetHostViewQt 2018-06-06 20:26:12 +02:00
Florian Bruhin
34d054e8a5 Revert "Use WrapperLayout instead of PseudoLayout"
This reverts commit 6cc920472ee4170b257a0b588687b175162e83df.

Since self._widget can go stale in the layout, we need to somehow solve this differently...
2018-06-06 20:26:12 +02:00
Florian Bruhin
e0213e7447 Use WrapperLayout instead of PseudoLayout 2018-06-06 20:26:12 +02:00
Florian Bruhin
cee88cd7ca Initial proof of concept for pseudo layout
Fixes #3920 - hopefully properly this time...
2018-06-06 20:26:12 +02:00
Florian Bruhin
5635639ed4 view-in-mpv: Remove --yes-playlist argument for youtube-dl
Reverts #3057
Fixes #3977
2018-06-06 09:59:03 +02:00
Florian Bruhin
982a42d453 Unbind Ctrl-Shift-Tab by default 2018-06-05 11:33:34 +02:00
pyup-bot
dc203d46de Update pytest-rerunfailures from 4.0 to 4.1 2018-06-04 19:00:21 +02:00
pyup-bot
62e86e1482 Update pytest-qt from 2.3.2 to 2.4.0 2018-06-04 19:00:19 +02:00
pyup-bot
9f9a5d576b Update pytest from 3.5.1 to 3.6.0 2018-06-04 19:00:18 +02:00
pyup-bot
46329b0f03 Update parse from 1.8.2 to 1.8.4 2018-06-04 19:00:16 +02:00
pyup-bot
454d026fdc Update more-itertools from 4.1.0 to 4.2.0 2018-06-04 19:00:14 +02:00
pyup-bot
e30e08a04e Update pyroma from 2.3 to 2.3.1 2018-06-04 19:00:13 +02:00
Slackhead
7858bb97d1 Change default bg colour to #000 2018-05-31 06:33:48 +01:00
Slackhead
8c1080de97 Change filter value to 85% to really darken it 2018-05-31 05:58:05 +01:00
Slackhead
d37b2713cf Change min-width to 0.2em 2018-05-31 05:45:43 +01:00
Slackhead
41a092cd80 Tweak style/animation 2018-05-31 04:50:41 +01:00
Slackhead
0fcbc209bb Add animation stopper/starter 2018-05-31 04:50:41 +01:00
Slackhead
1578a4836c Add fallback colours if inherit fails 2018-05-31 04:50:41 +01:00
Slackhead
f34d1b6ce1 Remove inherit styles 2018-05-31 04:50:41 +01:00
Slackhead
4cc2b919fa Change caret style 2018-05-31 04:50:41 +01:00
Florian Bruhin
5e99da5459 Remove broken shields.io badges
[ci skip]
2018-05-30 11:59:34 +02:00
theova
5543e75abd Add base16-qutebrowser 2018-05-29 20:00:49 +02:00
Florian Bruhin
6fc3546923 travis: Allow Archlinux to fail for now
See #3661
2018-05-29 13:19:05 +02:00
Florian Bruhin
52c44d3da6 setup.py: Set long_description_content_type
Otherwise, Warehouse (new PyPI) refuses the upload...
2018-05-29 11:23:10 +02:00
Florian Bruhin
b3c95c1668 Release v1.3.1
(cherry picked from commit ac29c579ff)
2018-05-29 11:15:15 +02:00
Florian Bruhin
f78410ef2b Update changelog for v1.3.1 2018-05-29 11:09:06 +02:00
Jay Kamat
28fce9a7cb Add support for opening background tabs in 5.11
Adding more workarounds to 442bdd4a4f, *sigh*
2018-05-26 13:52:57 -07:00
Jay Kamat
3392d82f50 Merge branch 'master' of https://github.com/qutebrowser/qutebrowser into jay/tab-bg-focus 2018-05-26 13:52:12 -07:00
Jay Kamat
c33a887b2d Add support for following tab selected elements to :follow-selected 2018-05-25 12:39:36 -07:00
Jay Kamat
cd56b97e7d Add an option to disable escape in the report dialog 2018-05-24 11:50:27 -07:00
Florian Bruhin
12e0edbcd0 Fix lint 2018-05-24 08:47:31 +02:00
Jay Kamat
40e391e199 Prevent closing :report dialog when pressing <escape> 2018-05-23 21:25:43 -07:00
Florian Bruhin
17cfb0d39c Add some more logging for #3920 2018-05-23 21:31:18 +02:00
Florian Bruhin
7162f15348 Use functools instead of a lambda for QTimer
It reads nicer, and this is also speculative fix for #3896 as PyQt5 is
hopefully better at disconnecting partial-objects from dead objects than it is
with lambdas.
2018-05-23 09:44:44 +02:00
Jay Kamat
74ea696a5c Merge branch 'master' of https://github.com/qutebrowser/qutebrowser into jay/tab-bg-focus 2018-05-22 23:17:52 -07:00
Jay Kamat
2f76ef1e53 Revert "Only apply workaround for QTBUG-68076 on non-background tabs"
This reverts commit 77c8575a88.
2018-05-22 23:17:43 -07:00
Florian Bruhin
26e37739e2 Fix typo 2018-05-22 23:07:31 +02:00
Florian Bruhin
e895ee8bdc Update changelog 2018-05-22 12:28:55 +02:00
Florian Bruhin
29ad252278 Handle ² keypress correctly
Turns out str.isdigit() also handles ² as a digit, but int('²') causes a
ValueError.

Here we use `string.digits` instead, which is '0123456789'.

Fixes #3743
2018-05-22 12:25:45 +02:00
Florian Bruhin
db1287cb82 Update changelog 2018-05-22 09:40:54 +02:00
Florian Bruhin
71ad8bdb47 Properly work around Qt 5.11 keyboard focus issues
Please let this be the last attempt... :D

Fixes #3939
Supersedes #3921
Reverts ae295a7f65
See #3661

This should not regress #3872. Might affect #3834 in some way.
2018-05-22 09:36:14 +02:00
Florian Bruhin
bc37af7c95 Document QtWebEngine internals
[ci skip]
2018-05-22 07:42:23 +02:00
Jay Kamat
3bf02aa62f Clarify install command for Ubuntu 17.04 2018-05-21 17:29:23 -07:00
Florian Bruhin
ae06c2cdb7 Merge pull request #3938 from qutebrowser/pyup-scheduled-update-2018-05-21
Scheduled weekly dependency update for week 20
2018-05-21 21:31:03 +02:00
Florian Bruhin
89f019b710 Remove unneeded "except ... as e:" assignments 2018-05-21 20:03:18 +02:00
pyup-bot
228c86c799 Update virtualenv from 15.2.0 to 16.0.0 2018-05-21 18:53:26 +02:00
pyup-bot
c551e29f4c Update pytest-qt from 2.3.1 to 2.3.2 2018-05-21 18:53:25 +02:00
pyup-bot
7596dbdd43 Update pytest-instafail from 0.3.0 to 0.4.0 2018-05-21 18:53:23 +02:00
pyup-bot
616371a3c1 Update hypothesis from 3.56.9 to 3.57.0 2018-05-21 18:53:22 +02:00
pyup-bot
725a133b9a Update cheroot from 6.2.4 to 6.3.1 2018-05-21 18:53:20 +02:00
pyup-bot
f60c42b7fb Update pylint from 1.8.4 to 1.9.1 2018-05-21 18:53:19 +02:00
pyup-bot
9dc9ec3435 Update astroid from 1.6.3 to 1.6.4 2018-05-21 18:53:17 +02:00
pyup-bot
e7a779ef90 Update setuptools from 39.1.0 to 39.2.0 2018-05-21 18:53:16 +02:00
pyup-bot
5ec3f1949a Update pyflakes from 1.6.0 to 2.0.0 2018-05-21 18:53:14 +02:00
pyup-bot
5df4128e8d Update pep8-naming from 0.6.1 to 0.7.0 2018-05-21 18:53:13 +02:00
Jimmy
47446baf29 s/obj/target/
Would a bit of consistency in variable names be too much to ask?
2018-05-21 21:23:38 +12:00
Jimmy
749b29e599 tests: Don't pretend to be using webkit if unavailable
Since `objects.backend` was being set to usertypes.Backend.QtWebKit by
default some feature detection code was calling
`version.qWebKitVersion()` which was failing because the import of
`PyQt5.QtWebKit` was failing in version.

This should not change behavior where both backends are available on if
any tests fail because they are expecting their environment to say they
are on webkit when they either aren't actually using any webkit features
or all mocked webkit features then they should probably be changed to
patch `objects.backend` or not depend on it.
2018-05-21 20:59:27 +12:00
Wayne Cheng
9a85796ac3 CR changes 2018-05-20 20:30:24 -04:00
Florian Bruhin
a31542269a Remove old files from MANIFEST.in 2018-05-20 16:12:33 +02:00
Wayne Cheng
36ddf3a328 Code review changes 2018-05-20 05:35:48 -04:00
Jimmy
d162e01422 Greasemonkey: remove extra window scope IIFE
Also change the block scoped `window` declaration to be const because it
seemed like a good idea. The real window seems to just silently ignore
attempts to overwrite it.
2018-05-20 18:42:40 +12:00
Jimmy
6573a4d616 Tell pylint to shut its fat mouth.
I just want to return something I can refer to the attributes of via dot
syntax without having to pointlessly write the names both when I declare
the data class and when I assign the variables.

Such a stupid warning.
2018-05-20 18:42:40 +12:00
Jimmy
b0d1a137da Greasemonkey: Don't attempt scope isolation on webkit
Since the JSCore used by WebKit 602.1 doesn't fully support Proxy and I
can't think of a way to provide isolation otherwise just revert to the
old behaviour in that case. I am checking for the specific WebKit
version because I'm pretty sure that version just happened to be
released when Proxy support was only partially done, any later release
will presumably have a newer JSCore where it works.

There I changed the indentation of a block in the jinja template which
will have inflated the diff.

I added mocking of `objects.backend` to the `webview` and
`webenginewebview` fixtures, I am pretty sure they are mutually
exclusive so don't expect any issues from that.

Because of the feature detection being at template compile time I had to
tweak the test setup to be done via a fixture instead of the setupClass
functionality that I was using before.
2018-05-20 18:42:40 +12:00
Jimmy
13249329f7 Greasemonkey: skip window scoping test on webkit
The implementation of Proxy in JSCore used by current QtWebkit (webkit
602.1) doesn't support the `set()` handler for whatever reason. So
instead of testing for a specific behaviour that we can't ensure on that
version let's just skip the tests and handle user complaints with
sympathy.
2018-05-20 18:42:40 +12:00
Jimmy
19242b6cb2 Greasemonkey: fix scoping function decleration.
Apparently making a function like `function foo() {};` in block scope is
illegal. It should be named via assignment.

Switched to an IIFE anyway because it doesn't need a name.
2018-05-20 18:42:40 +12:00
Jimmy
c7a9792b67 Greasemonkey: Add test for window scoping refinements.
Adds a test to codify what I think greasemonkey scripts expect from
their scope chains. Particularly that they can:

1. access the global `window` object
2. access all of the attributes of the global window object as global
   objects themselves
3. see any changes the page made to the global scope
4. write to attributes of `window` and have those attributes, and changes
   to existing attributes, accessable via global scope
5. do number 4 without breaking the pages expectations, that is what
   `unsafeWindow` is for

There are some other points about greasemonkey scripts' environment that
I believe to be true but am not testing in this change:

* changes a page makes to `window` _after_ a greasemonkey script is
  injected will still be visible to the script if it cares to check and
  it hasn't already shadowed them
* said changes will not overwrite changes that the greasemonkey script
  has made.
2018-05-20 18:42:40 +12:00
Jimmy
23bfe6daa2 Greasemonkey: fix window proxy for new attributes
Previously scripts were failing to find attributes that they assigned to
window and then tried to use from the global scope. Eg

    window.newthing = function() {...};
    newthing(...);  // newthing is not defined error

This wasn't the case for things that already existed in the global scope
and were just being overwritten.

This change just overrides the `Proxy.has()` function which seems to fix
it. Probably the `while` implementation was failing to pick up new
attributes because of the lack.

I also tweaked some comments and variable names and const-ness to be a
little more production ready.
2018-05-20 18:42:40 +12:00
Jimmy
ab50ad735b Greasemonkey: isolates scripts' writes to window
Since the global namespace of javascript in the browser is accessible
there where issues with scripts clobbering things that the page expected
to be attributes of window pages clobbering things that userscripts
saved to `window`. The latter was occuring with OneeChan. OneeChan was
setting `window.$` to a function that took a css selector and the 4chan
catalog script was setting `window.$` to some object. Since OneeChan was
set to run at document-start this broke OneeChan, switching it to
document-end broke scripts on 4chan.

I used OneeChan and 4chan-X on 4chan as the test case for this and
TamperMonkey as a guide for what is the correct way to handle scoping. I
didn't manage to pick apart just how TamperMonkey does what it does (I
think it might just be the environment that Chrome provides extensions
actually) but I got close to the same behaviour.

TamperMonkey provides a `window` object that appears to be what the
global window looked like before the webpage modified it. The global
scope though does have the pages modifications accessible. If the script
assigns something to an attribute `window` it can see that attribute in
the global scope. This implementation differs from that one in that, to
the scipt, `window` and the global scope always look the same, and that
is the same as the global scope looks in the environment provided by
TamperMonkey.

I am using the ES6 `Proxy` feature to allow the `window` object to look
like the actual (unsafe) one while allowing writing to it that doesn't
clobber the unsafe one. I am then using the ES4 `with` function to make
attributes of that window (proxy) object visible in the scope chain.
There may be other ways to do this without using `with` by using nested
functions and setting `this` creatively. There are notes around
alleging `with` to be various states of uncool[1].

I also ran into an issue where a userscript calling
`window.addEventListener(...)` would fail with `TypeError: Illegal
Execution` which is apparently due to `this` not being set correctly. I
looked at the functions which threw that error and those that didn't and
am using whether they have a `prototype` attribute or not to tell
whether I need to bind them with `window` as `this`. I am not sure how
correct that is but it worked for all the cases I ran into.

[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with
2018-05-20 18:42:40 +12:00
Wayne Cheng
7130f863cb Create lastpass implementation based off qute-pass code 2018-05-19 15:53:08 -04:00
Sebastian Heinlein
547edb3c4e appdata: install the metainfo using the Makefile
Furthermore add some information about the latest releases
and remove a few trailing whitespaces.
2018-05-19 13:57:26 +02:00
Jay Kamat
77c8575a88 Only apply workaround for QTBUG-68076 on non-background tabs
Previously, we would focus webviews even if they were in the
background to work around https://bugreports.qt.io/browse/QTBUG-68076.
This adjusts that to only occur when needed.
2018-05-18 10:46:53 -07:00
Joakim Särehag
4966a70709 Merge from main repo master, resolved conflict in webenginetab.py 2018-05-18 13:59:25 +02:00
Florian Bruhin
046c0a7ea2 Merge remote-tracking branch 'origin/pr/3914' 2018-05-17 17:53:47 +02:00
Florian Bruhin
d208c48532 Update changelog 2018-05-17 17:53:15 +02:00
Florian Bruhin
dacca0d2ed Remove double settings 2018-05-17 15:54:26 +02:00
Florian Bruhin
6ccd69dad2 Fix reload for JavaScript support on Qt 5.11 2018-05-17 15:54:17 +02:00
Florian Bruhin
d8569a36f9 Update changelog 2018-05-17 14:24:29 +02:00
Florian Bruhin
44d26f77a5 Add workaround for the "split page" Qt bug (QTBUG-68224)
Fixes #3920
2018-05-17 14:21:14 +02:00
Florian Bruhin
6eadff4a10 Add Python executable to :version 2018-05-14 22:13:15 +02:00
pyup-bot
6784356d9d Update hypothesis from 3.56.5 to 3.56.9 2018-05-14 18:48:20 +02:00
pyup-bot
b0105b0157 Update python-dateutil from 2.7.2 to 2.7.3 2018-05-14 18:48:18 +02:00
pyup-bot
553a91c012 Update python-dateutil from 2.7.2 to 2.7.3 2018-05-14 18:48:17 +02:00
pyup-bot
b0f83615b6 Update wheel from 0.31.0 to 0.31.1 2018-05-14 18:48:15 +02:00
pyup-bot
0c674c7110 Update flake8-builtins from 1.3.1 to 1.4.1 2018-05-14 18:48:14 +02:00
Jay Kamat
71d55e9213 Refocus command prompt after a new tab is opened when in command mode 2018-05-11 08:49:13 -07:00
Jay Kamat
95093b82c9 Refocus webview after spawning a background tab 2018-05-10 10:15:01 -07:00
Jay Kamat
538b4fafdb Revert "Restore focus to webview after clicking tab-bg"
This reverts commit 262cea8e75.
2018-05-10 09:30:28 -07:00
Jay Kamat
563afb277d Fix style issues 2018-05-10 08:04:48 -07:00
Jay Kamat
4bb048cb6a Fix mocked tests 2018-05-09 21:41:59 -07:00
Jay Kamat
ae04da7b78 Upgrade indicator to show recentlyAudible status 2018-05-09 18:57:53 -07:00
Jay Kamat
0642695c7d Update docs 2018-05-09 18:33:52 -07:00
Jay Kamat
7a297e2e3f Add support for muting tabs 2018-05-09 18:28:05 -07:00
Jay Kamat
bc9f178a08 Add test for tab-bg focus 2018-05-09 15:34:01 -07:00
Jay Kamat
262cea8e75 Restore focus to webview after clicking tab-bg 2018-05-09 11:05:07 -07:00
Joakim Särehag
dc7f39514d pull request #3864, reverted webview changes, fixed regression 2018-05-09 18:28:52 +02:00
Joakim Särehag
72c2962908 removed trailing whitespace 2018-05-09 15:52:22 +02:00
Joakim Särehag
cbf95d76bd Merge branch 'master' of https://github.com/qutebrowser/qutebrowser 2018-05-09 14:37:27 +02:00
Joakim Särehag
0e756d2f68 changes to pull request 3864, window.print for webengine 2018-05-09 14:36:03 +02:00
Florian Bruhin
48c44e1b4d Fix and update docs 2018-05-08 15:22:49 +02:00
Florian Bruhin
20efaeff19 Improve configuration docs 2018-05-08 14:57:56 +02:00
Florian Bruhin
d194a8ddb0 Merge pull request #3898 from qutebrowser/pyup-scheduled-update-2018-05-07
Scheduled weekly dependency update for week 18
2018-05-08 14:21:23 +02:00
Florian Bruhin
c8d539a4c6 Update changelog 2018-05-08 11:46:07 +02:00
Florian Bruhin
8531f89ca3 Merge remote-tracking branch 'origin/pr/3789' 2018-05-08 11:45:20 +02:00
Florian Bruhin
4fee9b9637 Update changelog 2018-05-08 11:44:06 +02:00
Florian Bruhin
89a1c43b4c Merge remote-tracking branch 'origin/pr/3790' 2018-05-08 11:43:30 +02:00
Florian Bruhin
a39858c436 Update changelog 2018-05-08 11:41:14 +02:00
Florian Bruhin
b718c8b43a Merge remote-tracking branch 'origin/pr/3899' 2018-05-08 11:40:43 +02:00
Florian Bruhin
b28bfbe8f5 Update docs 2018-05-08 11:39:35 +02:00
Florian Bruhin
70c7a42a63 Merge remote-tracking branch 'origin/pr/3900' 2018-05-08 11:37:52 +02:00
Florian Bruhin
648b1219a2 Filter flake8-builtins 1.4.0
See https://github.com/gforcada/flake8-builtins/issues/36
2018-05-08 11:34:17 +02:00
Florian Bruhin
d005088b6b Add missing fake_args fixture 2018-05-08 11:26:45 +02:00
Jay Kamat
906da44d70 Simplify visited link clearing by looping over connections 2018-05-07 14:10:20 -07:00
Jay Kamat
ca48f9f100 Clear url from visitedLinks if a single url is deleted 2018-05-07 13:48:38 -07:00
Jay Kamat
d0b2360745 Clear visited links db when running :history-clear on webengine 2018-05-07 13:35:41 -07:00
Pol Van Aubel
f1b481dcc7 Short options for --debug and --debug-flags 2018-05-07 22:35:32 +02:00
Pol Van Aubel
431a52da6c Short options for --basedir and --temp-basedir 2018-05-07 22:10:08 +02:00
pyup-bot
b109fc569f Update pytest-mock from 1.9.0 to 1.10.0 2018-05-07 18:39:22 +02:00
pyup-bot
fcd98443f9 Update flask from 1.0.1 to 1.0.2 2018-05-07 18:39:21 +02:00
pyup-bot
e455d8c13a Update pep8-naming from 0.5.0 to 0.6.1 2018-05-07 18:39:19 +02:00
pyup-bot
d4e5a2eb7f Update flake8-builtins from 1.3.1 to 1.4.0 2018-05-07 18:39:18 +02:00
pyup-bot
a4424f2863 Update attrs from 17.4.0 to 18.1.0 2018-05-07 18:39:17 +02:00
pyup-bot
9e33f1a275 Update attrs from 17.4.0 to 18.1.0 2018-05-07 18:39:15 +02:00
pyup-bot
470c392ee0 Update attrs from 17.4.0 to 18.1.0 2018-05-07 18:39:13 +02:00
Florian Bruhin
b9fc068af5 Add a log-requests debug-flag 2018-05-07 10:23:56 +02:00
Florian Bruhin
7762017f00 Release v1.3.0 2018-05-03 19:25:04 +02:00
Florian Bruhin
2ba40acf74 Update changelog for v1.3.0 2018-05-03 19:25:04 +02:00
Florian Bruhin
388c155ebb Add test for #3753 2018-05-03 18:02:20 +02:00
Florian Bruhin
adf2f9860d Disable spellcheck when it's unneeded.
Fixes #3753
2018-05-03 17:58:56 +02:00
Florian Bruhin
f528a5dd21 Update changelog 2018-05-03 17:56:24 +02:00
Florian Bruhin
f0f1a4a1d1 Merge remote-tracking branch 'origin/pr/3702' 2018-05-03 17:56:03 +02:00
Florian Bruhin
ae295a7f65 Call setFocus() when navigating
See #3661:
https://github.com/qutebrowser/qutebrowser/issues/3661#issuecomment-386308601
This doesn't seem to fully fix this, but at least the top four failed tests
there...

This should not regress #3872. Might affect #3834 in some way.
2018-05-03 17:43:19 +02:00
Jay Kamat
2663feea2f Add :hint inputs --first as a default binding to gi 2018-05-03 11:37:31 -04:00
Florian Bruhin
68794cc2e2 Revert "Always set FocusOnNavigationEnabled"
This reverts commit fa41af63b6.

See #3661
Fixes #3872
2018-05-03 15:25:41 +02:00
Florian Bruhin
acdf0a1c60 Call _handle_search before leaving the mode 2018-05-03 15:23:45 +02:00
Florian Bruhin
626abd3c83 Fix lint 2018-05-03 15:18:21 +02:00
Florian Bruhin
979b7cfaba Add a stop-gap solution for AssertionError when retrying downloads
See #3847
2018-05-03 14:52:10 +02:00
bitraid
1e5b325ea5 Move file_version_info.txt to misc/ and add it to .gitignore 2018-05-03 15:50:18 +03:00
Florian Bruhin
2b6b4e82a7 Handle event_target() being None
As a stop-gap solution for #3888
2018-05-03 14:45:55 +02:00
Florian Bruhin
80778a9ff3 Update changelog 2018-05-03 14:04:56 +02:00
Florian Bruhin
6eb8284fe0 Refactor handling search in command.py 2018-05-03 14:04:56 +02:00
Florian Bruhin
49bdcd5a97 Merge remote-tracking branch 'origin/pr/3796' 2018-05-03 13:58:26 +02:00
Florian Bruhin
106e591a36 Refactor matching of Greasemonkey scripts 2018-05-03 13:53:10 +02:00
Florian Bruhin
a70f864ff5 Update changelog 2018-05-03 13:33:53 +02:00
Florian Bruhin
4932cc4d24 Merge remote-tracking branch 'origin/pr/3804' 2018-05-03 13:33:08 +02:00
Florian Bruhin
2b5f133726 Update changelog 2018-05-03 13:23:30 +02:00
Florian Bruhin
5436e27e41 Merge remote-tracking branch 'origin/pr/3756' 2018-05-03 13:21:45 +02:00
Florian Bruhin
4adf10a2f2 Update changelog 2018-05-03 09:13:48 +02:00
Florian Bruhin
b80fa7a197 Merge remote-tracking branch 'origin/pr/3858' 2018-05-03 09:13:31 +02:00
Florian Bruhin
3cc790afb3 Update changelog 2018-05-03 09:10:14 +02:00
Florian Bruhin
91aa9f6c0c Merge remote-tracking branch 'origin/pr/3884' 2018-05-03 09:09:27 +02:00
Florian Bruhin
d6cacdb42f Merge pull request #3876 from qutebrowser/pyup-scheduled-update-2018-04-30
Scheduled weekly dependency update for week 17
2018-05-02 16:22:25 +02:00
Jimmy
19554ba4a1 Update PyPI api URL.
Flask 1.0 is out, pip made breaking changes, warehouse is a thing, new
requests soon. So
much fun in python world lately.
2018-05-02 23:08:51 +12:00
toofar
d16d9e403a Make HTTPClient follow redirects by default.
Closes #3875

The autoupdator, which uses `qutebrowser.misc.httpclient` has been failing recently because the URL that it hits to check version information is now serving a 301 moved permanently. By default QNetworkRequest doesn't follow redirects so it was getting back a (non-json, despite the request) body pointing to the new location, instead or version information. This changes fixes that by changing HTTPClient to use a QNetworkRequest subclass which follows redirects by default.

It lookes like HTTPClient is currently only used in autoupdate.py, version.py, and crashdialog.py so I don't expect any breakage.

5.6-5.8 Only had a boolean setting available which allows redirects, but not from the https scheme to http, 5.9 introduces a more nuanced setting. I have tested locally on 5.7.1 and 5.10.
2018-05-02 23:08:51 +12:00
pyup-bot
432d666d25 Update pytest from 3.5.0 to 3.5.1 2018-04-30 18:29:17 +02:00
pyup-bot
1c3ee0db20 Update flask from 0.12.2 to 1.0.1 2018-04-30 18:29:16 +02:00
pyup-bot
bdc0c0ddc1 Update setuptools from 39.0.1 to 39.1.0 2018-04-30 18:29:14 +02:00
pyup-bot
b9c8a79f10 Update flake8-builtins from 1.3.0 to 1.3.1 2018-04-30 18:29:13 +02:00
cryzed
801e9e0334 qute-pass: Improve fake_key_raw() 2018-04-29 15:22:52 +02:00
Joakim Särehag
199eac2db8 window.print() support for WebEngine 2018-04-24 14:05:53 +02:00
Florian Bruhin
cfa5ee2835 Merge pull request #3862 from qutebrowser/pyup-scheduled-update-2018-04-23
Scheduled weekly dependency update for week 16
2018-04-24 11:32:56 +02:00
Florian Bruhin
9c6437b3b9 Update comment 2018-04-24 09:53:41 +02:00
Florian Bruhin
486488e2cd Filter pycodestyle 2.4.0 for pyup
See https://github.com/PyCQA/pycodestyle/issues/741
2018-04-24 09:48:47 +02:00
Florian Bruhin
b4f877d991 Update changelog 2018-04-24 09:44:54 +02:00
cryzed
92aedf84f5 qute-pass: Don't use f-strings 2018-04-23 19:16:51 +02:00
cryzed
6825dfb8d8 qute-pass: Fake strings letter-by-letter to avoid issues 2018-04-23 19:01:12 +02:00
pyup-bot
d6c6014b85 Update pytest-mock from 1.8.0 to 1.9.0 2018-04-23 18:24:29 +02:00
pyup-bot
c1ac1d702f Update hypothesis from 3.55.1 to 3.56.5 2018-04-23 18:24:27 +02:00
pyup-bot
9e50b7afcc Update cheroot from 6.1.2 to 6.2.4 2018-04-23 18:24:25 +02:00
pyup-bot
1388880e7b Update github3.py from 1.0.2 to 1.1.0 2018-04-23 18:24:24 +02:00
pyup-bot
30d60ea740 Update github3.py from 1.0.2 to 1.1.0 2018-04-23 18:24:22 +02:00
pyup-bot
28cac01a1f Update pycodestyle from 2.3.1 to 2.4.0 2018-04-23 18:24:21 +02:00
pyup-bot
1689cb09f8 Update flake8-builtins from 1.2.2 to 1.3.0 2018-04-23 18:24:19 +02:00
pyup-bot
286c71a48a Update certifi from 2018.1.18 to 2018.4.16 2018-04-23 18:24:18 +02:00
pyup-bot
c073234a8d Update certifi from 2018.1.18 to 2018.4.16 2018-04-23 18:24:16 +02:00
pyup-bot
8c286412cb Update certifi from 2018.1.18 to 2018.4.16 2018-04-23 18:24:15 +02:00
pyup-bot
b3cef948b0 Update check-manifest from 0.36 to 0.37 2018-04-23 18:24:13 +02:00
Florian Bruhin
fa41af63b6 Always set FocusOnNavigationEnabled
This fixes some focus issues after Qt 5.11 changes. There might be better ways
to solve them, but for now, this will work.

See https://codereview.qt-project.org/#/c/221408/10 and #3661:
https://github.com/qutebrowser/qutebrowser/issues/3661#issuecomment-375969315

Might also negatively affect #3834 as it essentially reintroduces QTBUG-52999 on
any Qt version: https://bugreports.qt.io/browse/QTBUG-52999

Might be reverted at a later date, but for now, I want an easy way to make tests
work on Qt 5.11 to spot further issues.
2018-04-23 16:57:10 +02:00
Florian Bruhin
e789296b7f Handle new focus object for Qt 5.11
See https://codereview.qt-project.org/#/c/221408/10 and #3661:
https://github.com/qutebrowser/qutebrowser/issues/3661#issuecomment-375969315
2018-04-23 16:54:47 +02:00
Florian Bruhin
bc9a8dd63f Handle focusProxy being None
This fixes running with Qt 5.11

See https://codereview.qt-project.org/#/c/221408/10 and #3661:
https://github.com/qutebrowser/qutebrowser/issues/3661#issuecomment-375969315
2018-04-23 16:52:53 +02:00
Florian Bruhin
6640768860 Enable libGL workaround on any system where it's available
Fixes #3772
2018-04-23 11:20:56 +02:00
bitraid
3f1041eb0a gen_versioninfo.py: remove unused import, rename most variables and reformat 2018-04-22 20:35:34 +03:00
Michal Siedlaczek
c94ea5f8d4 Merge remote-tracking branch 'upstream/master' into filter-dict-names
Merging to investigate failed tests that seem unrelated to the PR.
2018-04-21 13:29:18 -04:00
Michal Siedlaczek
e2d249541d Fix test function comment 2018-04-21 12:33:10 -04:00
cryzed
2de6428830 qute-pass: Also escape backslashes in the username 2018-04-20 18:23:50 +02:00
cryzed
c2472d88f1 qute-pass: Escape backslashes, so that they are inserted correctly 2018-04-20 18:21:55 +02:00
bitraid
8c16d81d89 Pyinstaller: add VERSIONINFO resource to Windows executables. 2018-04-20 17:48:51 +03:00
Jay Kamat
1d2dd5bf55 Use CommandDispatcher directly for / searches 2018-04-19 21:16:33 -04:00
rr-
537aa22d64 Change clipboard mocking 2018-04-18 11:00:05 +02:00
rr-
30d3612a17 Add test for rapid yanking 2018-04-18 10:59:54 +02:00
Florian Bruhin
178eeaed0d Update changelog 2018-04-17 07:49:10 +02:00
Florian Bruhin
f1967718b7 Merge remote-tracking branch 'origin/pr/3791' 2018-04-17 07:48:46 +02:00
Jay Kamat
cbb246fd0b Update tests for new implementation 2018-04-16 23:28:32 -04:00
Jay Kamat
646e92707a Call search command directly instead of using arguments 2018-04-16 23:15:56 -04:00
Florian Bruhin
1021c3a330 Merge remote-tracking branch 'origin/pr/3826' 2018-04-16 17:26:59 +02:00
Florian Bruhin
ec57e58530 Update changelog 2018-04-16 17:21:42 +02:00
Florian Bruhin
06a8a68fcb Merge remote-tracking branch 'origin/pr/3844' 2018-04-16 17:21:13 +02:00
Florian Bruhin
4a78519b63 Mark opening/closing window via JS test as flaky 2018-04-16 17:14:47 +02:00
Florian Bruhin
d2207f66f1 Skip test_set_error entirely
See #3771
2018-04-16 17:14:14 +02:00
Florian Bruhin
23d4d72f3b Update changelog 2018-04-16 17:05:10 +02:00
Florian Bruhin
4a93389356 Merge remote-tracking branch 'origin/pr/3813' 2018-04-16 17:04:53 +02:00
Sebastian Heinlein
3704e3ddd5 Fix DESTDIR and PREFIX in makefile 2018-04-16 13:44:22 +02:00
rr-
563d9bd097 Fix crash in non-rapid link yanking 2018-04-16 08:52:06 +02:00
Florian Bruhin
643bf4bc20 Remove 32-bit check in build_release.py
This is probably not needed anymore, see #3842
2018-04-16 08:33:01 +02:00
Florian Bruhin
b89b38fd3c Use latest release of PyInstaller
This is as a stop-gap solution for #3842.
2018-04-16 08:28:24 +02:00
Jimmy
c5334fb683 Greasemonkey: use UrlPatterns for match directives
The greasemonkey `@match` directive is used to match urls against
chromium url patterns (as opposed to `@include` which treats its
argument as a glob expression). I was using fnmatch for both here
because I am lazy and knew someone else was going to implement chromium
url patterns for me eventually. Now it is done and I should switch to
using them instead. The most common failing case that this will fix is
something matching on `*://*.domain.com/*` because it wouldn't match
the url with no subdomain.

This codepath is only used on webengine 5.7.1 and webkit backends.
2018-04-14 10:31:20 +12:00
Jay Kamat
0829511221 Merge pull request #3803 from toofar/fix/greasemonkey_includes_fallback
Greasemonkey: fix default include value
2018-04-13 18:26:46 -04:00
Jay Kamat
48b865073c Update changelog 2018-04-13 12:21:12 -04:00
Jay Kamat
3f9099613b Merge pull request #3807 from slackhead/tabs.mute_messages
Add option to mute the Last Tab/First Tab messages when tabs.wrap is false
2018-04-13 12:11:45 -04:00
rr-
d705e600e2 Simplify num in hinting to first_run 2018-04-13 11:03:39 +02:00
Jay Kamat
77fa0730c8 Merge pull request #3802 from jgkamat/jay/tab-take-completion
Fix win_id 0 always being included in :tab-take completion
2018-04-10 16:24:48 -04:00
rr-
46e4aeb3e9 Don't hardcode newline 2018-04-10 08:45:23 +02:00
Jay Kamat
ed76d689b0 Add test for completing other buffer excluding id0 2018-04-10 02:45:12 -04:00
pyup-bot
ca311f8588 Update tox from 2.9.1 to 3.0.0 2018-04-09 18:13:31 +02:00
pyup-bot
849e427231 Update pytest-mock from 1.7.1 to 1.8.0 2018-04-09 18:13:29 +02:00
pyup-bot
9e628901e9 Update pytest-bdd from 2.20.0 to 2.21.0 2018-04-09 18:13:27 +02:00
pyup-bot
28126055da Update py-cpuinfo from 3.3.0 to 4.0.0 2018-04-09 18:13:26 +02:00
pyup-bot
3d75d86123 Update hypothesis from 3.52.0 to 3.55.1 2018-04-09 18:13:24 +02:00
pyup-bot
03ea07e99f Update cheroot from 6.0.0 to 6.1.2 2018-04-09 18:13:23 +02:00
pyup-bot
780ced8a52 Update pylint from 1.8.3 to 1.8.4 2018-04-09 18:13:21 +02:00
pyup-bot
fc33b065c2 Update astroid from 1.6.2 to 1.6.3 2018-04-09 18:13:20 +02:00
pyup-bot
03b7459b00 Update github3.py from 1.0.1 to 1.0.2 2018-04-09 18:13:18 +02:00
pyup-bot
f964bf1b67 Update github3.py from 1.0.1 to 1.0.2 2018-04-09 18:13:17 +02:00
pyup-bot
ef2a2702f5 Update wheel from 0.30.0 to 0.31.0 2018-04-09 18:13:15 +02:00
pyup-bot
6374b6dd4c Update flake8-builtins from 1.1.1 to 1.2.2 2018-04-09 18:13:14 +02:00
rr-
945bc44550 Support rapid hinting mode in yanking 2018-04-09 17:20:35 +02:00
toofar
69d642cab8 Merge pull request #3792 from toofar/fix/gm_addstyle_earlyload
Greasemonkey: fix early GM_addStyle with fast sites.
Seems to be a working fix, despite noone having clarity on what is the ideal approach.
2018-04-09 19:11:10 +12:00
Slackhead
62aa9bdbb3 Added debug() logging for next/prev-tab and test scenarios 2018-04-09 02:03:02 +01:00
Florian Bruhin
e35c91043e pyinstaller: Use '.' as path for git-commit-id
See #384
2018-04-08 20:46:43 +02:00
Slackhead
fac546e9b4 Remove test scenarios for last/first tab when wrap is off 2018-04-08 18:56:16 +01:00
Jay Kamat
b74ddc3493 Merge pull request #3820 from AlvaroLuken/master
Added surrounding gray box to launch command for Ubuntu + Tox
2018-04-08 13:39:16 -04:00
Slackhead
b7964d9baf Remove first/last tab messages 2018-04-08 10:31:12 +01:00
Jay Kamat
76dbfa7305 Allow searching for double semicolons
Possibly breaks scripts using :search with ;; to split commands. A
workaround is to put the :search command at the end.
2018-04-05 17:20:50 -04:00
AlvaroLuken
feb2f99ea9 Added surrounding gray box to launch command for Ubuntu + Tox 2018-04-05 11:22:38 -04:00
Jay Kamat
d0d5ad2eda Stop read timer when download is cancelled 2018-04-04 01:17:37 -04:00
Slackhead
eb18f0a2ac Adjust the help docs entry 2018-04-03 17:49:51 +01:00
Slackhead
39c08cb582 Add option to mute the Last Tab/First Tab messages when tabs.wrap is false 2018-04-03 16:27:04 +01:00
Jimmy
164ea98a5b Greasemonkey: fix default include value
Greasemonkey scripts are supposed to default to running on all pages.
@jgkamat and @nemanjan00 repurted some script not running on all pages
unless they either removed (or broke) the metadata block or added an
include directive. Indeed I had a logic error when it only defaulted to
being included on all pages when no metadata block at all was included.
Whoops.
2018-04-03 20:11:15 +12:00
Jay Kamat
3b2c0823af Fix win_id 0 always being included in :tab-take completion 2018-04-02 20:34:34 -04:00
Jay Kamat
9ad6cef369 Add a test for leading arguments 2018-04-01 21:00:02 -04:00
Jay Kamat
423192e9c9 Join text arguments for :search 2018-04-01 21:00:02 -04:00
Florian Bruhin
79823a9a0b Regenerate docs 2018-04-01 13:22:01 +02:00
Jimmy
1c0616f3ec Greasemonkey: fix early addstyle with fast sites.
nemanjan00 reported this script not having any effect da850e49cc/duckduckgo-deepdark.user.js

It turns out that the previous implementation of GM_addStyle was relying
on `document.onreadystatechange` when the script ran early enough that
there was no `head` element. That event wasn't getting fired for the
main frame of duckduckgo.com for whatever reason. Maybe using
`DOMContentLoaded` or something would have worked but I just copied the
fallback in the above linked script which seems to work just fine.
2018-04-01 12:38:48 +12:00
Ryan Roden-Corrent
bca07eebba Unit-test configmodel arg filtering.
Test that values the user has already input are omitted from the
suggestions. This brings configmodel coverage back to 100%.
2018-03-31 18:55:54 -04:00
pylipp
599a3d75a4 Add userscript to download bibtex for DOI scraped from current tab 2018-03-31 21:43:20 +02:00
Ryan Roden-Corrent
707fc1176d Regen completion if args change.
Allow completion functions to react dynamically to args as the user
inputs them. This allows config-cycle to filter out values that were
already provided.

Args provided after the maxsplit do not cause the completion to regen.
For example, successive words typed after `:open` just set the filter
pattern and do not spuriously regenerate the completion model.
2018-03-31 11:45:50 -04:00
Jay Kamat
cb8a75577e Add tests for hinting with --first 2018-03-30 15:03:08 -04:00
Jay Kamat
3d5d679561 Add basic implementation for clicking first hinted element 2018-03-30 15:03:08 -04:00
Florian Bruhin
6151d077e5 Update changelog 2018-03-30 11:49:39 +02:00
Florian Bruhin
d438aa15fa Simplify setting _qute_script_id 2018-03-30 11:48:06 +02:00
Jay Kamat
7f5a79cdfd Escape strings with string_escape rather than tojson 2018-03-30 01:40:49 -04:00
Florian Bruhin
5bc794f85a Update changelog 2018-03-28 21:11:20 +02:00
Florian Bruhin
d7455bcdba Merge remote-tracking branch 'origin/pr/3765' into adblock 2018-03-28 20:32:47 +02:00
Florian Bruhin
0b667e4701 Merge remote-tracking branch 'origin/pr/3763' into adblock 2018-03-28 20:32:39 +02:00
Michal Siedlaczek
d606cd5550 spell test formatting and docstrings 2018-03-28 14:13:46 -04:00
Michal Siedlaczek
7c1de99876 Fix test coverage 2018-03-28 12:16:50 -04:00
George Edward Bulmer
2789bec1e7 Modify assert_url to treat localhost differently 2018-03-28 14:27:17 +01:00
George Edward Bulmer
1ccb464d1c Return removed comment about hosts format 2018-03-28 14:17:13 +01:00
Florian Bruhin
758ea8b171 Update changelog 2018-03-28 09:36:32 +02:00
Florian Bruhin
32568a6da4 Simplify tests 2018-03-28 09:33:27 +02:00
Florian Bruhin
14792472db Merge remote-tracking branch 'origin/pr/3680' 2018-03-28 09:29:54 +02:00
Florian Bruhin
005fa8b675 Fix newline 2018-03-28 09:14:26 +02:00
Florian Bruhin
c7e5033eaa Set MainWindow as parent of TabbedBrowser
If we close the MainWindow (and it gets deleted), we need to make sure to delete
the TabbedBrowser as well.

Fixes #3781
2018-03-28 08:58:07 +02:00
Florian Bruhin
a828851640 Update recommended Qt version in readme 2018-03-28 08:48:18 +02:00
Jay Kamat
b873cfb18a Fix style issues in qute-keepass 2018-03-27 23:43:40 -04:00
Jussi Timperi
046a3dc159 Add option to only show favicons for pinned tabs
Closes #3440
2018-03-28 00:45:57 +03:00
Florian Bruhin
68b707c749 Update changelog 2018-03-27 12:01:42 +02:00
Florian Bruhin
9cff0e7367 Merge remote-tracking branch 'origin/pr/3742' 2018-03-27 12:01:18 +02:00
Florian Bruhin
7e66c3cf46 Update changelog 2018-03-27 11:11:34 +02:00
Florian Bruhin
bf4aab79ac Merge remote-tracking branch 'origin/pr/3751' 2018-03-27 11:11:12 +02:00
Florian Bruhin
a6f6fdf19b Update docs 2018-03-27 11:09:18 +02:00
Florian Bruhin
e5ffcbd49f Merge remote-tracking branch 'origin/pr/3750' 2018-03-27 11:07:29 +02:00
Florian Bruhin
730347e449 Merge branch 'pyup-scheduled-update-2018-03-26' 2018-03-27 10:27:59 +02:00
Florian Bruhin
55112b52e0 Merge remote-tracking branch 'origin/pr/3776' 2018-03-27 10:25:41 +02:00
Florian Bruhin
2249a88e3a Make test_simple_js_webengine work correctly 2018-03-27 07:29:43 +02:00
Florian Bruhin
6dbd6d1ddf Move test_qt_javascript.py 2018-03-27 07:14:05 +02:00
Florian Bruhin
6ecea8ef17 Revert accidental changes to test_qt_javascript.py 2018-03-27 07:13:17 +02:00
Florian Bruhin
021bb25622 Add regenerating website to contributing.asciidoc
[ci skip]

(cherry picked from commit 9f95736bbe4a00c9cc4a8b222ab3dc55d6bdf96c)
2018-03-26 22:53:46 +02:00
Florian Bruhin
22e887045b Remove flake8-builtins filter 2018-03-26 18:27:15 +02:00
pyup-bot
4896765fcc Update virtualenv from 15.1.0 to 15.2.0 2018-03-26 18:17:25 +02:00
pyup-bot
d98590d712 Update pytest-faulthandler from 1.4.1 to 1.5.0 2018-03-26 18:17:23 +02:00
pyup-bot
496e6fc624 Update pytest from 3.4.2 to 3.5.0 2018-03-26 18:17:22 +02:00
pyup-bot
55a818b156 Update py from 1.5.2 to 1.5.3 2018-03-26 18:17:20 +02:00
pyup-bot
85be0f2801 Update py from 1.5.2 to 1.5.3 2018-03-26 18:17:19 +02:00
pyup-bot
b7b4cc7f31 Update hypothesis from 3.50.0 to 3.52.0 2018-03-26 18:17:17 +02:00
pyup-bot
056a901da0 Update python-dateutil from 2.7.0 to 2.7.2 2018-03-26 18:17:16 +02:00
pyup-bot
ba9b166962 Update python-dateutil from 2.7.0 to 2.7.2 2018-03-26 18:17:15 +02:00
pyup-bot
edf2652431 Update flake8-builtins from 1.0.post0 to 1.1.1 2018-03-26 18:17:13 +02:00
Florian Bruhin
6755e17630 Update changelog 2018-03-26 10:54:15 +02:00
Florian Bruhin
d4899240de Break long lines 2018-03-26 10:51:04 +02:00
Florian Bruhin
ddbb6b5198 Merge remote-tracking branch 'origin/pr/3769' 2018-03-26 10:45:31 +02:00
Florian Bruhin
1087ce075d Merge remote-tracking branch 'origin/pr/3767' 2018-03-26 10:45:23 +02:00
Ryan Roden-Corrent
f237a87ad0 Completion for varargs.
When a command has positional varargs, keep offering the configured
completion for each successive argument.

Right now this only influences `config-cycle`.

Previously, `config-cycle <option> ` would offer a value completion for
only the first argument after the option. Now it will keep offering
value completion for each successive argument.

This will be useful for passing multiple tags to the new bookmark
commands that will be added for #882.
2018-03-25 21:59:30 -04:00
Philip Lewis
cecb79cf05 Fix keyhints for special characters
`prefix` is a string and `seq` is a key sequence, so removing `len(prefix)`
items from `seq` will remove too many if `prefix` contains a special character
(ex "<Ctrl+x>").  Remove the number of characters from `str(seq)` instead.
2018-03-25 15:18:02 -04:00
Florian Bruhin
d4ea1df232 Improve window_open.html tests 2018-03-25 19:56:48 +02:00
Florian Bruhin
91ca7d0911 tests: Rename close function in window_open.html
Naming it close() conflicts with the global JS close()
2018-03-25 19:39:34 +02:00
bitraid
68e3ad6cba Pyinstaller: don't use upx 2018-03-25 19:43:59 +03:00
Florian Bruhin
12a405965a Make QtWebEngine inspector work with JS disabled 2018-03-25 14:55:03 +02:00
George Edward Bulmer
a85ac1725f Missing fullstop in a docstring 2018-03-24 22:56:47 +00:00
George Edward Bulmer
eb5684e5f7 Pylint fix 2018-03-24 21:52:26 +00:00
George Edward Bulmer
b9bcad9c14 Grammar change 2018-03-24 21:13:22 +00:00
George Edward Bulmer
64b01cc076 Remove extraneous part 2018-03-24 21:10:23 +00:00
George Edward Bulmer
1380fef600 Add test for parsing multiple lines 2018-03-24 21:08:55 +00:00
George Edward Bulmer
8809ef02a1 Add support for more than 1 host on a given line 2018-03-24 20:20:16 +00:00
George Edward Bulmer
3f37fcf8fa Modify tests, localhost should never be blocked 2018-03-24 20:15:34 +00:00
George Edward Bulmer
c8db9e1c76 Remove WHITELISTED, making file parsing satisfy:
1) 'dotless' hosts, e.g. localhost, cannot be blocked by a file
2) hosts ending in '.localdomain' cannot be blocked by a file
2018-03-24 19:42:34 +00:00
George Edward Bulmer
01d8314dd8 Change default blocklist to StevenBlack combined 2018-03-24 18:35:03 +00:00
rien333
fa21d280fa Remove unnecessary hide operation 2018-03-24 05:09:03 +01:00
rien333
e211801e16 Handle wayland decoration option rename through configdata.yml 2018-03-23 15:24:18 +01:00
rien333
6db1ab0a58 Cosmetic changes 2018-03-23 15:21:02 +01:00
rien333
aa70395925 Merge branch 'master' of https://github.com/rien333/qutebrowser 2018-03-23 15:19:58 +01:00
rien333
880b33fff5 Restore correct window visibility after decoration config change 2018-03-23 15:19:37 +01:00
Florian Bruhin
f1789effdc Stabilize navigate.feature on Qt 5.11
Looks like we get qute://help as URL from the previous test otherwise?
See #3661
2018-03-23 10:29:25 +01:00
Florian Bruhin
e095f64eb6 Merge remote-tracking branch 'origin/pr/3752' 2018-03-23 08:25:59 +01:00
Florian Bruhin
06df88075e Merge remote-tracking branch 'origin/pr/3749' 2018-03-23 08:25:49 +01:00
Florian Bruhin
00bdb60627 Ignore "Dropping message on closed channel." message
This seems to happen with this test in tabs.feature with Qt 5.11:
Scenario: :buffer with wrong argument (-1)

It only happens ~1/50 times though, and seems like some Qt bug.

See #3661
2018-03-23 07:59:46 +01:00
rien333
1fc0abb064 Delete .#configfiles.py 2018-03-23 02:50:36 +01:00
Jay Kamat
a1776087e0 Fix login when only one entry is available 2018-03-22 21:35:00 -04:00
Jay Kamat
948866f4f2 Add support for keepass keyfiles 2018-03-22 21:21:59 -04:00
rien333
e2250d65e9 Merge branch 'master' of git://github.com/qutebrowser/qutebrowser 2018-03-23 01:43:23 +01:00
rien333
bb0c79b5a2 Fix wayland test 2018-03-23 01:38:45 +01:00
rien333
ff299c87a8 Reinsert wayland specific code for toggling decoration visibility 2018-03-22 23:32:37 +01:00
rien333
2d2bdad2ca Do not require restart after decoration option change 2018-03-22 23:26:45 +01:00
Jay Kamat
07d043fe81 Add basic tests for tab width sizing 2018-03-22 14:27:33 -04:00
Jay Kamat
477da6002a Fix minimum size for vertical tabs 2018-03-22 12:59:35 -04:00
Jay Kamat
d2c01d7ee6 Always display plain titles in tab tooltips
Closes #3741
2018-03-22 12:03:15 -04:00
Florian Bruhin
b67a031151 Rephrase autoconfig.yml docs
[ci skip]
2018-03-22 08:37:12 +01:00
Jay Kamat
a9a7f5da45 Fix choking on passwords with <x> syntax in them 2018-03-22 03:01:50 -04:00
Jay Kamat
b169a1c802 Add raw first draft of qute-keepass
This needs a lot more work...
2018-03-22 02:43:15 -04:00
rien333
764e79e505 Small refactor 2018-03-22 03:44:24 +01:00
rien333
7b7faa9f66 Fix silly redefinition 2018-03-22 03:42:57 +01:00
rien333
a6b92dbbd3 General window decoration hiding option 2018-03-22 02:23:21 +01:00
bitraid
4fb940241c Add 32bit color for Windows icon 2018-03-21 23:13:26 +02:00
George Edward Bulmer
51f9464eb2 Add test for hints with numberpad numbers 2018-03-21 17:06:13 +00:00
George Edward Bulmer
0645865d22 Add test case for is_special in keyutils 2018-03-21 16:38:58 +00:00
George Edward Bulmer
991ba54499 Change the formatting of the numpad keys
This makes it consistent with as before
2018-03-21 15:41:08 +00:00
George Edward Bulmer
1cf3d66a22 Revert test and modify returned key 2018-03-21 15:34:32 +00:00
Florian Bruhin
300d873b18 Update Debian install instructions
Supersedes #3707
Fixes #3737

[ci skip]
2018-03-21 10:55:54 +01:00
Florian Bruhin
a8bbd5fa4d Update docs for TimestampTemplate 2018-03-21 10:14:48 +01:00
Florian Bruhin
2d655a7230 Update changelog 2018-03-21 08:27:09 +01:00
George Edward Bulmer
4d7f8e4878 Pylint fix 2018-03-21 00:28:52 +00:00
George Edward Bulmer
bc885cc9ee Modify the keypad test
The new behaviour is for the keypad to yield its usual key,
such that instead of a special <Num+2> keypress, it yields <2>
2018-03-20 23:19:36 +00:00
George Edward Bulmer
a5dc8a3025 Fix crash in string representation of key 2018-03-20 23:13:56 +00:00
George Edward Bulmer
d6463d5ade Remove Qt.KeypadModifier as a special key 2018-03-20 22:33:11 +00:00
bitraid
7601e58c81 Merge remote-tracking branch 'upstream/master' 2018-03-20 23:54:18 +02:00
Ryan Roden-Corrent
16bda94e2b Remove unused import and TODO from urlmarks test. 2018-03-20 21:41:19 +00:00
Ryan Roden-Corrent
5a20052bce Add unit tests for urlmarks. 2018-03-20 21:41:19 +00:00
bitraid
e316f1768e More compatible icon for Windows
Fixes #3601
2018-03-20 23:28:42 +02:00
Florian Bruhin
11696f0073 Fix test_configinit 2018-03-20 22:16:16 +01:00
Florian Bruhin
f9d976880e Disable shared web workers on Qt < 5.11 2018-03-20 21:14:04 +01:00
Florian Bruhin
a5f1022330 Log document.body in JS tests 2018-03-20 11:56:46 +01:00
Florian Bruhin
85d3d4baba Mark test_set_error as flaky 2018-03-20 10:25:03 +01:00
Florian Bruhin
561295238d Another try at stabilizing test_set_error 2018-03-20 08:58:48 +01:00
Florian Bruhin
0e670a597e Update docs 2018-03-20 08:53:59 +01:00
Florian Bruhin
0fd3674d9e Update changelog 2018-03-20 07:07:05 +01:00
Florian Bruhin
0ee9d73fe2 Merge remote-tracking branch 'origin/pr/3692' 2018-03-20 07:05:43 +01:00
Florian Bruhin
81827a3150 Try to stabilize stylesheet tests 2018-03-20 07:05:03 +01:00
Florian Bruhin
32145d579b Merge branch 'pyup-scheduled-update-2018-03-19' 2018-03-20 07:00:37 +01:00
Florian Bruhin
f230fd3abb Rebuild requirement files 2018-03-20 06:59:57 +01:00
Florian Bruhin
51318d66c8 Fix ignore for new flake8-per-file-ignores release 2018-03-20 06:55:05 +01:00
Florian Bruhin
59602ec5b5 requirements: Blacklist flake8-builtins 1.1.0
See https://github.com/gforcada/flake8-builtins/issues/19
2018-03-20 06:55:05 +01:00
Florian Bruhin
a374698693 Fix lint 2018-03-20 06:38:11 +01:00
Florian Bruhin
b56988f0a4 Update changelog 2018-03-20 06:27:48 +01:00
Florian Bruhin
32df91fbae Merge remote-tracking branch 'origin/pr/3604' 2018-03-20 06:24:57 +01:00
Jay Kamat
f6c00babbe Prevent minimumTabsizeHint from being called when booting on mac
Move workaround higher up to the start of tabSizeHint
2018-03-19 18:29:51 -04:00
Florian Bruhin
7eaad59be3 caret: Ignore None value from setInitialCursor
See #3583
2018-03-19 22:32:26 +01:00
Florian Bruhin
ea1e52ea7c Load page before loading stylesheets
If we don't do this, when doing:

   self.config_stub.val.content.user_stylesheets = css_path

then _update_stylesheet gets called before the stylesheet QWebEngineScript did
run (as there was no load yet), so we get:

  [:2] Uncaught TypeError: Cannot read property 'stylesheet' of undefined!

Instead, load the page first and then update the stylesheet.
This tests that live updating works properly, and also makes sure we don't run
into the problem described above.
2018-03-19 21:44:47 +01:00
Florian Bruhin
b588f54a53 Fail javascript tests on logging messages 2018-03-19 20:43:55 +01:00
Florian Bruhin
9031b3e535 Remove @pyqtSlot for on_download_requested
For some reason, this breaks when test_pac is run...
2018-03-19 20:17:15 +01:00
Florian Bruhin
1162e640c5 Remove unused imports 2018-03-19 19:42:56 +01:00
Florian Bruhin
0ea7a1457d Make test_position_caret work again
The tests only work properly with QtWebKit (and aren't needed on QtWebEngine).
Also, for some reason the scrolled_down tests only work without Xvfb.
2018-03-19 19:38:21 +01:00
Florian Bruhin
f5d7605ae0 Add a :scroll-to-anchor command
Fixes #2784
2018-03-19 19:18:33 +01:00
Florian Bruhin
e50068021d Use signals to update statusbar in caret mode
This means we don't use objreg anymore to get the status bar, and also makes the
bar more accurately reflect reality.

See #3583
2018-03-19 18:44:06 +01:00
Florian Bruhin
460bd86579 Initial attempt at using the tab API for tests/unit/javascript 2018-03-19 18:18:21 +01:00
Florian Bruhin
e43f0a61b9 Move all QWebEngineScript related code out of webenginesettings
It looks like there's some issue with QWebEngineScript in a profile, at least
with older Qt versions...

See #3497, #3377
2018-03-19 17:33:02 +01:00
pyup-bot
8eb4d15805 Update hypothesis from 3.49.0 to 3.50.0 2018-03-19 17:13:26 +01:00
pyup-bot
3b7e1b3fe2 Update pylint from 1.8.2 to 1.8.3 2018-03-19 17:13:25 +01:00
pyup-bot
650aa532cd Update astroid from 1.6.1 to 1.6.2 2018-03-19 17:13:23 +01:00
pyup-bot
1f3fc756db Update github3.py from 0.9.6 to 1.0.1 2018-03-19 17:13:22 +01:00
pyup-bot
2d5d485daf Update github3.py from 0.9.6 to 1.0.1 2018-03-19 17:13:20 +01:00
pyup-bot
b77e43d74f Update setuptools from 38.5.2 to 39.0.1 2018-03-19 17:13:18 +01:00
pyup-bot
5a26858e07 Update flake8-per-file-ignores from 0.5 to 0.6 2018-03-19 17:13:17 +01:00
pyup-bot
99ea4b98e8 Update flake8-builtins from 1.0.post0 to 1.1.0 2018-03-19 17:13:15 +01:00
Florian Bruhin
da8b6fb50a Decrease maximum repetitions for QtWebEngine scrolling
At least for Qt debug builds, 5000 seems to be much too much.
See #3661
2018-03-19 14:11:01 +01:00
Florian Bruhin
33066af51d Break long comment 2018-03-19 13:59:30 +01:00
Florian Bruhin
6a971e2846 Ignore OnDidStopLoading error message
See #3661, https://bugreports.qt.io/browse/QTBUG-66661
2018-03-19 12:13:10 +01:00
Florian Bruhin
f28a39571c Fix caret.js indent 2018-03-19 11:49:24 +01:00
Florian Bruhin
bee04a1eec Wait until runner is finished in test_custom_env
This seems to at least lead to less warnings when running the test.
2018-03-19 11:43:08 +01:00
Florian Bruhin
39d25c1127 Update _chromium_version comment
[ci skip]
2018-03-19 11:15:19 +01:00
Florian Bruhin
07e831cee5 Update changelog 2018-03-19 10:28:25 +01:00
Florian Bruhin
b3342d8f70 Merge remote-tracking branch 'origin/pr/3728' 2018-03-19 10:28:04 +01:00
Florian Bruhin
6465d64738 Fix lint 2018-03-19 10:22:21 +01:00
Florian Bruhin
232fd19422 Fix unit tests after refactoring 2018-03-19 09:53:35 +01:00
Florian Bruhin
a4530797ea Add a ProfileSetter class to webenginesettings
Easier than passing a profile around everywhere.
2018-03-19 09:40:57 +01:00
Florian Bruhin
1b84bbd61d Refactor initialization of internal JavaScript
- Initialize JavaScript in webenginesettings.py instead of webenginetab.py
- Move JavaScript snippet into a .js file
- Make sure scripts can be re-run and do nothing if already run.
- Run scripts on DocumentCreation *and* DocumentReady. Closes #3717.
- Give each script an unique name for debugging.
- Also make custom stylesheets work on chrome:// pages
2018-03-19 09:14:55 +01:00
Florian Bruhin
f2864c6253 Break greasemonkey_wrapper lines differently 2018-03-19 09:13:50 +01:00
Florian Bruhin
8ae3047f2a Update changelog 2018-03-18 19:00:07 +01:00
Florian Bruhin
b154846bdc Merge remote-tracking branch 'origin/pr/3733' 2018-03-18 18:59:41 +01:00
Florian Bruhin
8a3d9c0c01 Adjust ignored log messages for Qt 5.11 2018-03-18 18:58:29 +01:00
AlternateData
62d30fe589 use 0 and maxint as bounds 2018-03-18 10:06:41 +01:00
AlternateData
a52d18b700 Add correct maximum and minimum value for tabs.switching_delay 2018-03-17 17:59:31 +01:00
Marc Jauvin
b7159d780a Merge 'origin/master' into tab-input-mode 2018-03-16 14:28:36 -04:00
Michal Siedlaczek
f9e702bae5 Warn about malformed dictionaries 2018-03-16 11:28:45 -04:00
gammelon
f57e47c742 Separate tests for _get_search_url 2018-03-16 11:42:51 +01:00
Bryan Bugyi
18146e2fbc Fix: prevent unmatched quote (#3726) 2018-03-16 06:16:16 -04:00
Florian Bruhin
f7074b80d0 Fix lint 2018-03-16 09:07:25 +01:00
Bryan Bugyi
fa282d574d Fix: preserve exit status of task command (#3726) 2018-03-16 03:44:22 -04:00
Bryan Bugyi
3b0b4ffe66 Fix: restrict output of task to one line (closes #3726) 2018-03-16 03:28:44 -04:00
Florian Bruhin
a6ce188e0d Update changelog 2018-03-16 08:21:11 +01:00
Florian Bruhin
01845faac5 Set window title/icon on correct object
This was a regression introduced in #3613.
Fixes #3727
2018-03-16 08:20:27 +01:00
Florian Bruhin
69a013bc82 Update changelog 2018-03-15 14:53:20 +01:00
Florian Bruhin
6f8eb419ae Emit predicted_navigation when loading sessions
This avoids reloads (because of changed settings) after a session has been
loaded.

Related to #3718
2018-03-15 14:51:36 +01:00
Florian Bruhin
1e4b80d1ac Don't emit predicted_navigation when reloading because of it
When we reload because of a config change in _on_load_finished, we can't use
self.reload() as no URL is set yet. Instead, we call self.openurl with the
current URL.

However, we need to make sure we don't emit predicted_navigation again at that
point.

This should (finally) fix #3718
2018-03-15 14:44:44 +01:00
Florian Bruhin
5dbda3016b Clean up predicted_navigation handling
This also adds some more logging for #3718
2018-03-15 14:16:10 +01:00
Florian Bruhin
1d25b212d5 Add missing qapp fixtures to tests
See #3723
2018-03-15 09:06:40 +01:00
Florian Bruhin
f538fc8b74 Update release checklist
[ci skip]
2018-03-14 21:50:22 +01:00
Florian Bruhin
c2b995edde Update build_release for github3.py 1.0 2018-03-14 21:11:03 +01:00
Florian Bruhin
1d562d919e Include requirements files in built release
This is needed to use "tox -e mkvenv"
2018-03-14 21:10:35 +01:00
Florian Bruhin
a60bae30b7 Release v1.2.1
(cherry picked from commit 6145786e46)
2018-03-14 20:20:20 +01:00
Florian Bruhin
523502785a Update changelog for v1.2.1 2018-03-14 20:17:34 +01:00
Florian Bruhin
84c7c37e8e Swap Control/Meta back on macOS
Fixes #3697

(cherry picked from commit fd9e7bed7fd9842eac22ed304a094a92cc953577)
2018-03-14 19:40:56 +01:00
Florian Bruhin
d232b3ea57 Disable test_software_rendering on macOS
For some reason, macOS doesn't care about us disabling software rendering
2018-03-14 19:31:36 +01:00
Florian Bruhin
7a861b7119 Update changelog 2018-03-14 18:19:11 +01:00
Florian Bruhin
a22f973c99 Don't emit predicted_navigation for reloads at all
When we reload a page because of a config change, we won't get another
titleChanged signal (at least sometimes).

Also, the predicted_navigation signal is worthless when reloading anyways, as
we're going to load the same URL and not something different.

Fixes #3718
2018-03-14 18:19:11 +01:00
Florian Bruhin
724e531087 Merge pull request #3715 from toofar/docs/greasy-faq
Greasemonkey: add FAQ entry.
2018-03-14 11:13:21 +01:00
Florian Bruhin
5c73910a33 Revert "Insert qutebrowser scripts on DocumentCreation and DocumentReady"
This reverts commit fac0f66e52.
2018-03-14 10:19:23 +01:00
Florian Bruhin
84bae210ab Fix wrong number in cheatsheet 2018-03-14 09:06:04 +01:00
Jimmy
e5edc0f940 fixup! Greasemonkey: add FAQ entry.
Change the wording and the `--debug` suggestion.

Add comma after "this is currently not supported", I was tempted to add
a semicolon before it to but I resisted.

Added a "then" after QtWebEngine version list, not a comma.
2018-03-14 20:25:59 +13:00
Florian Bruhin
0d21265005 Update changelog 2018-03-14 08:07:38 +01:00
Florian Bruhin
c0fdf19756 Merge remote-tracking branch 'origin/pr/3704' 2018-03-14 08:06:24 +01:00
Florian Bruhin
102b2be361 Update changelog 2018-03-14 07:56:00 +01:00
Florian Bruhin
fac0f66e52 Insert qutebrowser scripts on DocumentCreation and DocumentReady
In #3521, the injection point was changed to DocumentReady as a fix for
https://bugreports.qt.io/browse/QTBUG-66011 / #3490.

However, that prevents e.g. using hints before a page is fully loaded, which can
be annoying on a mobile connection.

Instead, just run the scripts twice, which won't hurt and makes sure they're
available.
2018-03-14 07:50:41 +01:00
Jimmy
2563ecf6d8 Greasemonkey: add FAQ entry.
The most common questsions regarding greasemonkey support on IRC are
"how do I use it" and "why doesn't my script work", hopefully this can
be a starting point for most people experiencing issues.
2018-03-14 19:48:46 +13:00
Florian Bruhin
64530375ab Update changelog 2018-03-14 07:44:51 +01:00
Marc Jauvin
c9f6cd507b address requested changes
- add INPUT_MODES & PROMPT_MODES constants in modeman
- use those in tabbedbrowser and modeman
- fix debug logs format to be more human readable
- fix associated tests for new debug logs
2018-03-13 23:31:48 -04:00
Jay Kamat
7278b7c2e5 Improve wording of documentation 2018-03-13 22:25:26 -04:00
Jay Kamat
35beff98a9 Add test for #3711 2018-03-13 19:18:42 -04:00
Jay Kamat
a6e94cf30c Fix hinting in frames on qt5.9 with input ranges 2018-03-13 18:54:08 -04:00
Florian Bruhin
8e01353a94 Update changelog 2018-03-13 14:41:40 +01:00
Florian Bruhin
8b9c6ccee2 Split up BaseKeyParser.handle into functions 2018-03-13 14:40:54 +01:00
Florian Bruhin
b88ac51d25 Fall back to non-keypad keys without any keypad bindings
Fixes #3701
2018-03-13 14:40:54 +01:00
Ryan Roden-Corrent
73517f0a51 Fix test_backup_error.
- Need caplog at level error
- Rename test to be unique
2018-03-13 08:50:34 -04:00
Markus Ongyerth
40364ce774 view-source pygments feedback pass 2018-03-13 12:40:51 +01:00
Ryan Roden-Corrent
27966c94a6 Fix up editor backup patch.
- Use qutebrowser-editor-backup as the backup file prefix
- Consistently use message.error instead of cmdexc
- Improve test coverage for the backup function
- Fix lint errors in the unit test code
2018-03-13 07:34:18 -04:00
Florian Bruhin
a7b6d179d4 Update changelog 2018-03-13 09:51:03 +01:00
Florian Bruhin
1c9598d2c0 Don't emit predicted_navigation with invalid URLs
Fixes #3706
2018-03-13 09:46:09 +01:00
Florian Bruhin
dcd6bcd2f4 Apply changes from PR review 2018-03-13 08:47:41 +01:00
Florian Bruhin
c590648077 Merge remote-tracking branch 'origin/pr/3613' 2018-03-13 08:39:36 +01:00
Florian Bruhin
80843c0b53 Update changelog 2018-03-13 07:39:04 +01:00
Florian Bruhin
14d6e737fa Merge remote-tracking branch 'origin/pr/3606' 2018-03-13 07:37:57 +01:00
Florian Bruhin
9c613fb700 Merge pull request #3705 from qutebrowser/pyup-scheduled-update-2018-03-12
Scheduled weekly dependency update for week 10
2018-03-12 18:57:36 +01:00
pyup-bot
01aa1f755d Update pytest from 3.4.1 to 3.4.2 2018-03-12 17:10:19 +01:00
pyup-bot
3855d49821 Update hypothesis from 3.48.0 to 3.49.0 2018-03-12 17:10:18 +01:00
pyup-bot
55c24cad9a Update setuptools from 38.5.1 to 38.5.2 2018-03-12 17:10:16 +01:00
Ryan Roden-Corrent
38bb3673db Preserve a backup if editor callback fails.
Currently the editor deletes its temp file whenever editing is finished.
With this patch, the file will not be deleted if the editor callback
encounters an exception.

One example is if the tab containing the edited element is closed. The
editor errors with "Edited element vanished", but with this patch it
will also print "Backup at ..." so the user does not lose their work.

Resolves #1596.

Supersedes #3641, using the cleaner approach started in #1677.
2018-03-12 08:34:50 -04:00
gammelon
455f6b8a70 Fix blank lines 2018-03-12 12:37:52 +01:00
Florian Bruhin
8c5b7bcd03 Fix lint 2018-03-12 08:51:36 +01:00
Florian Bruhin
a6885a0d41 Update changelog 2018-03-12 08:03:20 +01:00
Florian Bruhin
9941812127 Normalize keys read from the config
This makes sure the internal bindings.commands object only contains normalized
key sequences.

Fixes #3699
2018-03-12 08:00:56 +01:00
Florian Bruhin
990c0707f4 Make from_obj() work for List/Dict configtypes
We can't easily make it work for ListOrValue as we don't know which of both we
get at this point.
2018-03-12 08:00:18 +01:00
Florian Bruhin
c03ef10d54 tests: Add a yaml_config_stub fixture 2018-03-12 07:39:20 +01:00
Florian Bruhin
d72691ee49 Simplify ListOrValue configtype 2018-03-12 07:38:56 +01:00
Michal Siedlaczek
29eadf7141 Filter installed dictionaries using a regex to ensure correct name 2018-03-11 17:50:20 -04:00
Florian Bruhin
27c2650245 build_release: Wait before detaching volume
This hopefully helps with detaching it properly.
2018-03-11 21:06:31 +01:00
Florian Bruhin
b0bf02e23a Update changelog 2018-03-11 21:05:10 +01:00
Florian Bruhin
30ab1d0218 Force PyQt 5.10.0 with "tox -e mkvenv-pypi"
Fixes #3662
2018-03-11 20:47:01 +01:00
Florian Bruhin
7f68affa30 Merge remote-tracking branch 'origin/pr/3695' 2018-03-11 14:36:06 +01:00
Florian Bruhin
b6e29d8eae Be explicit about expected output in test 2018-03-11 14:35:15 +01:00
Florian Bruhin
591883656e Merge remote-tracking branch 'origin/pr/3700' 2018-03-11 14:34:06 +01:00
Florian Bruhin
f0a649e101 Mark another GreaseMonkey test as flaky
See #3238
2018-03-11 14:29:54 +01:00
Roman Bogorodskiy
d0342bffc4 Show version for POSIX OSes
For POSIX OSes other than Linux and macOS set OS Version to
platform.uname() instead of showing 'OS Version: ?'.
2018-03-11 13:28:53 +04:00
Florian Bruhin
75ab8f077d Fix keybinding cheatsheet URLs in quickstart.asciidoc
The URLs and the patching were changed in
96e8151cce but not in quickstart.asciidoc.
2018-03-11 08:30:41 +01:00
Florian Bruhin
d9f7d401c6 Handle ImportError in version.opengl_vendor
Fixes #3698
2018-03-11 08:15:22 +01:00
Florian Bruhin
5f01c7e79a Release v1.2.0 2018-03-09 22:40:59 +01:00
Jay Kamat
996561b50e Apply tabs.min_width to all tabs when tabs are unshrunk 2018-03-09 14:36:01 -05:00
Sebastian Noack
4cf0311d7f Updated flake8-per-file-ignores to version 0.5 2018-03-09 14:09:49 -05:00
Johannes Wegener
cf4e472461 add basic completion to file dialog 2018-03-09 16:21:57 +01:00
gammelon
0ce94dae1c forgot one bit 2018-03-09 15:55:40 +01:00
gammelon
7e3c966afe rewrite tests 2018-03-09 15:52:03 +01:00
Florian Bruhin
39eb512b27 Fix lint 2018-03-09 14:13:29 +01:00
Florian Bruhin
ebb373ccad Make sure keys with modifiers get handled as special 2018-03-09 09:04:28 +01:00
Florian Bruhin
c7cccf4ba0 Clear key chains when a special key is pressed in hint mode
When we press "s<Escape>", we don't want <Escape> to be handled as part of a key
chain.
2018-03-09 08:43:07 +01:00
Jay Kamat
1672995639 Clean up style issues 2018-03-09 02:19:49 -05:00
Jay Kamat
4a78b0519d Add tabs.min_width setting
Controls min width in pixels of non pinned tabs

Closes #3690
2018-03-09 02:05:49 -05:00
Jay Kamat
46533c3367 Fix pinned tabs being too small in extreme situations 2018-03-09 02:02:31 -05:00
Florian Bruhin
66b06ed84c Add first tests for HintKeyParser 2018-03-09 07:38:16 +01:00
Florian Bruhin
b789e436b8 Fix lint 2018-03-09 07:07:04 +01:00
jakanakae-envangel
0cd73af691 keyinput: Merge keyparser into modeparsers 2018-03-08 19:55:43 +01:00
Florian Bruhin
63d23ca9df Add compiled=False to version checks 2018-03-08 18:48:35 +01:00
Florian Bruhin
9af07d86d6 Don't double HTML escape JavaScript messages
See https://bugreports.qt.io/browse/QTBUG-66104
2018-03-08 18:23:36 +01:00
Florian Bruhin
f561272f9a Remove old comments
See #3687

[ci skip]
2018-03-08 15:48:34 +01:00
Florian Bruhin
2b2473a6d8 Add security entry FAQ
Fixes #3686
2018-03-08 12:58:17 +01:00
Florian Bruhin
0134c1fcfd travis: Test Python 3.5 with Qt 5.7.1
Might run more stable, and makes more sense anyways.
2018-03-08 12:28:10 +01:00
Florian Bruhin
c01f674234 Add Chromium versions to _chromium_version comment 2018-03-08 12:27:41 +01:00
Florian Bruhin
482b622b1b Fix handling of empty bindings without breaking :unbind
1899e313fd as a fix for #3631 broke :unbind, as
the config system treats None and '' equally.

Instead, allow None/'' again, but just handle it as "no binding".
2018-03-08 11:42:27 +01:00
Florian Bruhin
1899e313fd Disallow binding to an empty command
This was introduced (most likely accidentally) in
9cbacf3264.

Fixes #3631
2018-03-08 08:14:52 +01:00
Florian Bruhin
d5c04318b2 Fix test/lint 2018-03-08 06:41:15 +01:00
Florian Bruhin
87c6644751 Add predicted_navigation for reload()
This should avoid a double-reload for 'tsh' etc.
2018-03-07 23:54:58 +01:00
Florian Bruhin
b9d26ee268 Add an input.insert_mode.auto_enter setting
Closes #3143
2018-03-07 23:45:19 +01:00
Florian Bruhin
9b9d7647a4 Show the keystring correctly when entering a count 2018-03-07 22:47:31 +01:00
Florian Bruhin
514138aad2 Allow to bind numbers in keybindings
This mostly reverts 4ef5db1bc4 for #1966, but
fixes #3684 by allowing numbers to be bound again. If the user wants to bind
numbers instead of using them for a count, why not let them.
2018-03-07 22:37:10 +01:00
Florian Bruhin
34815f5cf8 Make bindings.default only settable in autoconfig.yml
Fixes #3131
2018-03-07 18:30:44 +01:00
Marc Jauvin
7c2802e843 beautify code as requested 2018-03-07 11:46:14 -05:00
Marc Jauvin
5992688926 Save input modes when mode_on_change=='restore' 2018-03-07 11:43:17 -05:00
Florian Bruhin
8a60855b88 Fix lint 2018-03-06 21:44:37 +01:00
Florian Bruhin
e2cdb5c8cf Allow empty vlaue for bindings.key_mappings 2018-03-06 21:43:07 +01:00
Florian Bruhin
0d94c17edc Apply key_mappings to KeySequences correctly
Fixes #3678
2018-03-06 21:39:57 +01:00
Florian Bruhin
db7ccb0434 Update config tests for pattern changes 2018-03-06 13:26:22 +01:00
Florian Bruhin
e1a03929e3 Edit changelog 2018-03-06 13:14:00 +01:00
Florian Bruhin
06bccfeb78 Improve error message for QtWebEngine inspector 2018-03-06 12:57:38 +01:00
Florian Bruhin
0236255a7e Require a reload for more settings 2018-03-06 12:57:28 +01:00
Florian Bruhin
b6efe65891 Add input.spatial_navigation to needs_reload
See #3648
2018-03-06 11:33:36 +01:00
Florian Bruhin
3701eb121f Also remove Qt 5.8 from Travis 2018-03-06 11:23:43 +01:00
Florian Bruhin
69a58c9597 Remove Qt 5.8 support and tests
With QtWebKit it's probably okay to still use it (*cough* Hyperbola
GNU/Linux-libre^tm *cough*), and only blacklisting it with QtWebEngine would be
quite some effort.

Fixes #3608
2018-03-06 11:04:59 +01:00
Florian Bruhin
ea1ff1c1ea Regenerate docs 2018-03-06 10:49:59 +01:00
Florian Bruhin
e28a01351b Add toggling to cheatsheet 2018-03-06 10:49:53 +01:00
Florian Bruhin
e3b8372b8b Make UrlPattern._DEFAULT_PORT private 2018-03-06 10:34:02 +01:00
Florian Bruhin
257753841b Allow lightweight URL patterns without a scheme
See #3622
2018-03-06 10:33:55 +01:00
Florian Bruhin
7fc53ae78a Make path optional in URL patterns
See #3622
2018-03-06 09:45:06 +01:00
Florian Bruhin
de3d2b1cb1 Update userscripts 2018-03-06 09:37:00 +01:00
Florian Bruhin
8c0bca90d3 Merge remote-tracking branch 'origin/pr/3456' 2018-03-06 09:32:39 +01:00
Florian Bruhin
2c03bc3410 Update changelog 2018-03-06 07:47:11 +01:00
Florian Bruhin
513bb381d3 Merge remote-tracking branch 'origin/pr/3676' 2018-03-06 07:46:46 +01:00
Florian Bruhin
0a75c5a302 Make sure options in needs_reload are valid 2018-03-06 07:44:20 +01:00
Florian Bruhin
afd5d2c728 Reload page after content.javascript.can_access_keyboard changed
See #3648
2018-03-06 07:41:35 +01:00
Florian Bruhin
0e2a39da2a Fix tests for keyboard parsing change 2018-03-06 07:39:41 +01:00
Florian Bruhin
c9cd47b5b1 Also clear favicons when possible with QtWebEngine
See #3469
2018-03-06 07:38:01 +01:00
Florian Bruhin
41dfa29648 Improve parsing of invalid keys
This should handle "<>" and "\x1f" correctly.
2018-03-06 06:29:38 +01:00
Olmo Kramer
8a193e2dc5 Add hints to <summary> elements 2018-03-06 03:46:40 +01:00
Florian Bruhin
7a9f8fda72 Get rid of unnecessary lambda 2018-03-05 23:07:03 +01:00
Florian Bruhin
2b84ea9dbe Make sure we have plain keys/modifiers where needed 2018-03-05 23:01:24 +01:00
Florian Bruhin
0ee7fac727 Update test_init_unknown/test_init_invalid for KeyboardModifierMask
-1 & Qt.KeyboardModifierMask == Qt.Key_unknown
2018-03-05 22:56:58 +01:00
Florian Bruhin
78f6ad14c2 Use Qt.KeyboardModifierMask 2018-03-05 22:33:16 +01:00
Florian Bruhin
3b957c5f2e Merge pull request #3673 from qutebrowser/pyup-scheduled-update-2018-03-05
Scheduled weekly dependency update for week 09
2018-03-05 22:24:08 +01:00
Florian Bruhin
8deb38e22d Add test for :bind completion with invalid binding 2018-03-05 22:21:57 +01:00
Florian Bruhin
29fdd1acc4 Make sure all keyboard modifiers are handled correctly
This handles Qt.KeypadModifier (Num+...) correctly, adds tests for converting
modifiers to strings, and strips Qt.GroupSwitchModifier as QKeySequence doesn't
know about it.

Fixes #3675
2018-03-05 22:11:26 +01:00
Florian Bruhin
2ab270dfac Also log modifiers for key presses 2018-03-05 19:32:21 +01:00
Florian Bruhin
fb626ca5a8 Update changelog 2018-03-05 18:40:14 +01:00
Florian Bruhin
9be26a8bfd Merge remote-tracking branch 'origin/pr/3666' 2018-03-05 18:38:37 +01:00
Florian Bruhin
333a37ffb2 Fix old macOS-specific test code 2018-03-05 18:30:34 +01:00
Florian Bruhin
9320214429 Only clear favicons on load with QtWebKit
QtWebEngine seems to automatically clear the favicon when loading e.g.
about:blank, and not clearing it there again fixes #3469.
Original issue: #187
2018-03-05 18:29:01 +01:00
Florian Bruhin
43cab4d978 Add bindings to toggle plugins
See #3622
2018-03-05 18:20:06 +01:00
Florian Bruhin
4da8af0e1d Fix preloading resources on Windows
We always pass paths like javascript/scroll.js no matter what the underlying OS
is, so we also need to cache it with a / separator.
2018-03-05 18:08:51 +01:00
Florian Bruhin
a796d1f33f Always enable JavaScript for file://, chrome:// and qute://
See #3622
2018-03-05 17:09:47 +01:00
pyup-bot
0299bd9764 Update pytest-mock from 1.7.0 to 1.7.1 2018-03-05 17:07:19 +01:00
pyup-bot
17e2915876 Update hypothesis from 3.46.0 to 3.48.0 2018-03-05 17:07:18 +01:00
pyup-bot
1006f181e2 Update packaging from 16.8 to 17.1 2018-03-05 17:07:16 +01:00
Florian Bruhin
430d69f278 Fix lint 2018-03-05 16:43:01 +01:00
Florian Bruhin
a1b73fc113 Elide long URLs in acceptNavigationRequest logging 2018-03-05 16:42:14 +01:00
gammelon
a730290d40 Use QUrl for parsing, add tests 2018-03-05 16:32:41 +01:00
Florian Bruhin
cdbff411d0 Fix travis_install for newer Homebrew 2018-03-05 15:51:26 +01:00
Florian Bruhin
d1854eddaf Handle invalid keys coming from Qt
When pressing a key which doesn't exist as Qt.Key, we don't get Qt.Key_unknown
like we'd expect, but we get 0x0 instead...

Let's add that as a new "nil" key (to not conflict with None/unknown/zero/...)
and handle it appropriately.

This can be reproduced by doing:
setxkbmap -layout us,gr -option grp:alt_shift_toggle
and pressing Alt-Shift/Shift-Alt.
2018-03-05 15:42:52 +01:00
Florian Bruhin
52c280ec12 Add unit tests for BaseKeyParser.handle with dry_run=True 2018-03-05 15:33:56 +01:00
Florian Bruhin
3275681afd Show key when the key string is empty 2018-03-05 12:45:13 +01:00
Florian Bruhin
67b4502fdb Fix test_version without cssutils 2018-03-05 11:36:50 +01:00
Florian Bruhin
2f8686ec70 Fix test_mhtml_e2e with Qt 5.11
See #3661
2018-03-05 11:36:29 +01:00
Florian Bruhin
cc5da4d1fe Fix test_modeman.py 2018-03-05 11:08:21 +01:00
Florian Bruhin
b4a2352833 Cache HTML/JS resource files when starting
This mostly reverts 9edc5a665e (see #1362).
Fixes #1943
2018-03-05 09:08:06 +01:00
Florian Bruhin
78623f4ec8 Update changelog
[ci skip]
2018-03-05 08:15:47 +01:00
Florian Bruhin
2a9d970641 Uninstall application proxy factory before exit
This should help with segfaults on exit.
Fixes #3657
2018-03-05 07:39:36 +01:00
Florian Bruhin
274f2a9d19 Rename eventFilter methods in modeman 2018-03-05 06:36:01 +01:00
Florian Bruhin
e01db79ce9 Filter out ShortcutOverride events properly
Fixes #3419
2018-03-05 06:32:54 +01:00
Florian Bruhin
4ef5db1bc4 Disallow numbers in keybindings
Fixes #1966
2018-03-04 23:17:51 +01:00
Florian Bruhin
47525f6a09 Update changelog 2018-03-04 22:58:33 +01:00
Florian Bruhin
155a1901c0 Merge branch 'keys' 2018-03-04 22:50:41 +01:00
Florian Bruhin
88a5c8d29d Make sure bindings with umlauts work
See #303
2018-03-04 22:38:33 +01:00
Florian Bruhin
e2f17c4be1 Always prefer exact over partial matches 2018-03-04 21:45:46 +01:00
Florian Bruhin
40c3295cd1 Improve logging message for clear_keystring 2018-03-04 21:32:42 +01:00
Florian Bruhin
f2fadd7add Fix handling of key_mappings 2018-03-04 21:32:28 +01:00
Florian Bruhin
0967b6abd2 Fix handling of </> keys 2018-03-04 20:40:16 +01:00
Florian Bruhin
910bbc8521 Refactor keyutils._parse_keystring 2018-03-04 20:40:05 +01:00
Florian Bruhin
c9c0bc0bbd Update docs 2018-03-04 20:28:46 +01:00
Florian Bruhin
d8bfe23c0d Fix lint 2018-03-04 20:21:58 +01:00
Florian Bruhin
58b7599152 Remove old fixme 2018-03-04 20:21:58 +01:00
Florian Bruhin
f85e69ec77 Refactor other keyinput tests 2018-03-04 20:21:58 +01:00
Florian Bruhin
2be7db29ed 100% coverage for keyinput.keyutils 2018-03-04 20:21:58 +01:00
Florian Bruhin
8da878c77c Make KeySequence.matchs() work correctly 2018-03-04 20:21:58 +01:00
Florian Bruhin
866c758660 Add more KeySequence tests 2018-03-04 20:21:58 +01:00
Florian Bruhin
68db8d04ad KeySequence: Make sure we got valid key codes 2018-03-04 20:21:58 +01:00
Florian Bruhin
3649a36869 KeySequence: Add __le__/__ge__ 2018-03-04 20:21:58 +01:00
Florian Bruhin
fb7c75a090 Improve keyutils tests 2018-03-04 20:21:58 +01:00
Florian Bruhin
3c9e8ff9ab Test and fix keyutils._parse_keystring 2018-03-04 20:21:58 +01:00
Florian Bruhin
7f8508a367 Change the way Space keybindings are handled
Using it as " " in a keystring won't work anymore, but instead <Space> and
<Shift-Space> does.
2018-03-04 20:21:58 +01:00
Florian Bruhin
da60d11b24 Refactor keyutils tests 2018-03-04 20:21:58 +01:00
Florian Bruhin
b3834835ed Bring back keyutils.is_modifier() and modifier handling
Turns out when we press yY, we get three events:

Qt.Key_Y, Qt.NoModifier
Qt.Key_Shift, Qt.ShiftModifier
Qt.Key_Y, Qt.ShiftModifier

If we don't ignore the second one, our keychain will be interrupted by the Shift
keypress.
2018-03-04 20:21:58 +01:00
Florian Bruhin
e306e2dadb Improve and fix test_is_printable 2018-03-04 20:21:58 +01:00
Fritz Reichwald
d9a88e139c Test for modifiers and corner case 0xFF 2018-03-04 20:21:58 +01:00
Florian Bruhin
3a11a24be0 Fix modifier handling
We don't want to show <Shift-Shift>, but <Ctrl-Shift> should still work
correctly.
2018-03-04 20:21:58 +01:00
Florian Bruhin
7cb781cc92 Simplify handling of modifier-only keys
Now that we don't rely on str(KeyInfo) being empty anywhere, there's no reason
to return an empty string for only-modifier keypresses anymore.

While those keys can't be bound (QKeySequence('Shift') == Qt.Key_unknown)
there's also no reason to explicitly ignore them.
2018-03-04 20:21:57 +01:00
Florian Bruhin
693178c8ee Refactor KeyInfo.__str__
This removes the special handling for macOS, but this is hopefully not needed
anymore as we don't compare strings.
2018-03-04 20:21:57 +01:00
Florian Bruhin
af6e5b1838 Fix lint 2018-03-04 20:21:57 +01:00
Florian Bruhin
fac8d72d8c Capitalize Escape in TestFullscreenNotification 2018-03-04 20:21:57 +01:00
Florian Bruhin
a57fc5c746 Refactor keyutils tests involving all keys 2018-03-04 20:21:57 +01:00
Florian Bruhin
50d2ef3b90 Fix handling of printable control keys in KeyInfo.text() 2018-03-04 20:21:57 +01:00
Florian Bruhin
4223e2f85d Check all keys against QTest::keyToAscii 2018-03-04 20:21:57 +01:00
Fritz Reichwald
d28c323074 Add printable and ismodifier test 2018-03-04 20:21:57 +01:00
Florian Bruhin
934d586286 Fix handling of Shift-Tab aka. Backtab 2018-03-04 20:21:57 +01:00
Florian Bruhin
65a05f334e Fix KeyInfo.__str__ for <Shift-Tab> 2018-03-04 20:21:57 +01:00
Florian Bruhin
4e505d52df Regenerate docs 2018-03-04 20:21:57 +01:00
Florian Bruhin
0aa17bfa33 Simplify unicodedata.category calls 2018-03-04 20:21:57 +01:00
Florian Bruhin
63e05e12ba Fix lint and tests 2018-03-04 20:21:57 +01:00
Florian Bruhin
e26eaaddc2 Add keyutils.is_modifier_key() 2018-03-04 20:21:57 +01:00
Florian Bruhin
1cd86d79d9 Add keyutils.is_printable() 2018-03-04 20:21:57 +01:00
Florian Bruhin
b4d232badd Simplify KeyInfo.text() 2018-03-04 20:20:31 +01:00
Florian Bruhin
2ca15d7667 Add tests for lower-/uppercase text 2018-03-04 20:20:31 +01:00
Florian Bruhin
8c87040cb6 Improve IDs for qt_key fixture 2018-03-04 20:20:31 +01:00
Florian Bruhin
0b6d2c2b0a Make all key names work 2018-03-04 20:20:30 +01:00
Florian Bruhin
601e56d2fa Make test_keyutils work 2018-03-04 20:20:30 +01:00
Florian Bruhin
8f479407a0 key_data: Update key names to reflect reality
Generated by:

import key_data
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QKeySequence

for key in key_data.KEYS:
    attr = key.attribute
    member = getattr(Qt, 'Key_' + attr, None)
    if member is None:
        continue
    name = QKeySequence(member).toString()
    if name != attr:
        try:
            print("    Key('{}', '{}')".format(attr, name))
        except UnicodeEncodeError:
            print("    Key('{}', '{}')  # FIXME".format(attr, name.encode('unicode-escape').decode('ascii')))
    else:
        print()
2018-03-04 20:20:30 +01:00
Florian Bruhin
f714be0ff7 Initial tests on all Qt keys 2018-03-04 20:20:30 +01:00
Florian Bruhin
19512e988b Expose less from keyutils publicly 2018-03-04 20:20:30 +01:00
Florian Bruhin
880da2d143 Add missing default=True for configmodel.bind 2018-03-04 20:20:30 +01:00
Florian Bruhin
2ed480b40a Refactor configmodel.bind 2018-03-04 20:20:30 +01:00
Florian Bruhin
fdc2458657 Fix test_split_count after _handle_key merge 2018-03-04 20:20:30 +01:00
Florian Bruhin
c3485821c7 Adjust copyright 2018-03-04 20:20:30 +01:00
Florian Bruhin
77e0b8983c Point to Debian repos for .deb downloads
[ci skip]
Fixes #3669
2018-03-04 18:51:16 +01:00
Jimmy
6d415b6653 Greasemonkey: don't inject JS into dead frames
Hopefully closes #3627

This feels like fixing the symptom instead of the problem but I am not
sure how such a situation would arise. Never the less, the crash logs
clearly show that `_inject_userjs()` is being called with a deleted
frame sometimes. It is being called from a closure that gets triggered
on frame.loadFinished so I am not sure how frame could be deleted at
that time unless:
* the error message is misleading and it is actually some reference to
  the object that is no longer valid
* the frame gets deleted from some other handler of loadFinished.
2018-03-03 15:10:44 +13:00
Jimmy
0adda22d3c Greasemonkey: add a way to register scripts directly.
Previously to add a greasemonkey script you had to write it to the
greasemonkey data directory and call load_scripts(). Now you can just
make a new GreasemonkeyScript and pass it to add_script(), yay.

There are no users of the method yet although I could have used it while
writing the tests.
2018-03-03 15:02:43 +13:00
Jimmy
7dab8335e2 Greasemonkey: handle downloads that complete fast
When `@require`ing local files (with the `file://` scheme) the
greasemonkey manager was not catching the DownloadItem.finished signal
because it was being emitted before it had managed to connect.

I didn't see this happening while testing with files that should have
been in cache but I wouldn't be surprised.

I had to change the download mock to be able to give it the appearance
of asynchronicity. Now when using it one must set download.successful
appropriately before firing download.finished. I also added a list of
downloads to the stub so a test could enumerate them in case the
unit-under-test didn't have a reference to them.
2018-03-03 15:02:43 +13:00
Jimmy
87a0c2a7a7 Greasemonkey: indent source of required scripts
This is for the case where a script uses `@require` to pull down another
greasemonkey script. Since QWebEngineScript doesn't support `@require`
we pass scripts to it with any required ones pre-pended. To avoid
QWebEngineScript parsing the first metadata block, the one from the
required script, we indent the whole lot. Because the greasemonkey spec
says that the //==UserScript== text must start in the first column.
2018-03-03 15:02:42 +13:00
Jimmy
60e6d28eb1 Greasemonkey: webkit: Don't use Object.entries in js.
Apparently the currently available QtWebkit's javascript engine doesn't
support Object.entries[1]. It was only using that because I had copied
it from the official gm4 polyfill (maybe I should open an issue there?).

Tested with libqt5webkit5 version 5.212.0~alpha2-5 (debian) and I was
getting the same type of failures as Travis so it looks like this is the
case in arch too.

[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries
2018-03-03 15:02:42 +13:00
Jimmy
919fe45813 Greasemonkey: Add test for @require support.
There's is a lot of asserts in that one test but it tests everything.
2018-03-03 15:02:42 +13:00
Jimmy
fa1ac8d93c Move download_stub to helpers/fixtures
I am adding support for downloading dependant assets in
browser/greasemonkey and want to mock the download manager for testing.
2018-03-03 15:02:42 +13:00
Jimmy
cba93954cd Allow download_stub test fixture to handle file targets. 2018-03-03 13:14:49 +13:00
Jimmy
2307a0850f Greasemonkey: Support greasemonkey-reload --force.
Added a new argument to the greasemonkey-reload command to support
also re-downloading any `@required` scripts.
2018-03-03 13:14:49 +13:00
Jimmy
b91e2e3267 Allow download manager to overwrite existing files unprompted.
This is to support the non-interactive use case of setting a
`FileDownloadTarget` and passing auto_remove and not caring if the target
file exists or not.

An alternative to adding the attribute to `FileDownloadTarget` and
having set_target pull it out would be to add a new param to `fetch()`
and `set_target()`. But it would only be used for one target type
anyway.
2018-03-03 13:14:49 +13:00
Jimmy
a7b74d8e83 Greasemonkey: give required scripts a readable filename. 2018-03-03 13:14:49 +13:00
Jimmy
33d66676c9 Greasemonkey: mock the new GM4 promises based API.
Based on the gm4-polyfill.js script from the greasemonkey devs. But not
the same because that script doesn't work for us for a couple of
reasons:

* It assumes all GM_* functions are attributes of `this` which in
this case is the global window object. Which breaks it out of our iife.
It is possible to change what `this` is within the iife but then we
would have to do something weird to ensure the functions were available
with the leading `this.`. And I don't think user javascripts tend to
call GM functions like that anyway, that polyfill script is just making
weird assumptions and then claiming it'll work for "any user script
engine".

* It tries to provide implementations of GM_registerMenuCommand and
GM_getResource text which do unexpected thins or implement a circular
dependency on the new version, respectively.
2018-03-03 13:14:49 +13:00
Jimmy
a76c0067e1 Greasemonkey: Add support for the @require rule.
The greasemonkey spec states that user scripts should be able to put the URL
of a javascript source as the value of an `@require` key and expect to have
that script available in its scope. This commit supports deferring a user
script from being available until it's required scripts are downloaded,
downloading the scripts and prepending them onto the userscripts code before
placing it all in an iffe.

TODO:
* should I be saving the scripts somewhere else? Maybe the cache dir?
  The are just going to data/greasemonkey/requires/ atm.
2018-03-03 13:14:49 +13:00
Florian Bruhin
02c313eafd Add packages needed with tox 2018-03-02 10:22:59 +01:00
Florian Bruhin
be7a21eb56 Make sure the backend is set in test_webenginesettings.py 2018-03-02 07:00:09 +01:00
Florian Bruhin
b0c25e1bed Add missing )
I shouldn't be allowed to push at 6:30 AM...
2018-03-02 06:58:37 +01:00
Florian Bruhin
9721881261 Adjust @issue3572 check for Qt 5.10.1 2018-03-02 06:37:01 +01:00
Florian Bruhin
5d68dc08d5 Update changelog 2018-03-02 06:35:04 +01:00
Florian Bruhin
067be7aaa2 Simplify mock checks 2018-03-02 06:33:56 +01:00
Florian Bruhin
6fc560fc78 Rewrite comment 2018-03-02 06:31:23 +01:00
Florian Bruhin
fb7fa0cb49 Merge remote-tracking branch 'origin/pr/3652' 2018-03-02 06:31:00 +01:00
Florian Bruhin
52129f2e4d Merge remote-tracking branch 'origin/pr/3659' 2018-03-02 06:30:52 +01:00
Ryan Roden-Corrent
d5e30fd728 Don't crash first completion update with min_chars.
When min_chars is nonzero, if the first command that opens the
completion has < min_chars on the word under the cursor, it triggers a
check for a condition where last_cursor_pos is None.

By setting last_cursor_pos=-1 we ensure that the completer always
updates the first time it is opened, and that there is never a check
against None.

This adds a test for the min_chars feature.

Resolves #3635.
2018-03-01 22:07:53 -05:00
Jay Kamat
a2b5bf0b73 Clear old search results on webkit
Fixes an issue with #3626
2018-03-01 16:15:38 -05:00
Ryan Roden-Corrent
2965f954ba Resolve empty completion.timestamp_format crash.
Resolves #3628.
2018-03-01 07:54:20 -05:00
Florian Bruhin
257011a6d2 Fix installing codecov on Travis 2018-03-01 12:56:43 +01:00
Florian Bruhin
f33d659924 Release v1.1.2 2018-03-01 09:15:54 +01:00
Markus Ongyerth
f7bcdfc818 Add --pygment argument to view-source
The --pygment argument allows to use the pygment version of view-source
over the qtwebengine internal one.
This version is slightly different in what's processed before the site
is generated, so some javascript created texts can be available.
2018-02-28 16:53:28 +01:00
Florian Bruhin
b14a37cf1f Update changelog for v1.1.2
[ci skip]
2018-02-28 16:14:34 +01:00
Florian Bruhin
7fd0b52360 Add missing newline
[ci skip]
2018-02-28 08:11:23 +01:00
Florian Bruhin
8ea6cf352b Remove unneeded version check
The option isn't going to magically change as the config system prevents that.
2018-02-28 08:08:47 +01:00
Florian Bruhin
f3aaa1084a Migrate spell tests to unittests 2018-02-28 08:08:23 +01:00
Florian Bruhin
824825e67d Make sure we only show dictionary warnings once
After 3956f81e73 where this was made a function,
the warning was shown twice, causing AppVeyor to fail.
2018-02-28 08:01:11 +01:00
Florian Bruhin
889b03169a Upgrade to PyQt 5.10.1 2018-02-28 06:28:01 +01:00
Florian Bruhin
e6aa6b8235 Add missing docs for {url:host} 2018-02-27 17:29:36 +01:00
Florian Bruhin
5eb340d481 Add missing tests for completions 2018-02-27 15:55:00 +01:00
Florian Bruhin
60f0175a36 Fix getting customized options
This was broken with per-domain settings
Fixes #3649
2018-02-27 15:39:57 +01:00
Florian Bruhin
5a5873d4ee Rename KeyConfig._prepare to ._validate 2018-02-27 14:16:41 +01:00
Florian Bruhin
49d297f7bf Fix tests for parsing KeySequences 2018-02-27 14:10:55 +01:00
Florian Bruhin
b85fe8f678 Merge BaseKeyParser._handle_key into .handle 2018-02-27 14:08:38 +01:00
Florian Bruhin
3a79f1293f Remove FIXMEs 2018-02-27 13:10:25 +01:00
Florian Bruhin
244590f49d Handle unknown keys with :bind/:unbind 2018-02-27 13:09:48 +01:00
Florian Bruhin
88b5007457 Consolidate invalid :bind/:unbind tests 2018-02-27 13:02:32 +01:00
Florian Bruhin
7a27469ecd Handle unknown keys in :bind completion 2018-02-27 13:02:32 +01:00
Florian Bruhin
8090d3e289 Handle invalid keys in config.py 2018-02-27 13:02:32 +01:00
Florian Bruhin
898f5c50c4 Add a test for utils.chunk 2018-02-27 13:02:32 +01:00
Florian Bruhin
bd87b4eb10 Stop logging in PassthroughKeyParser 2018-02-27 13:02:32 +01:00
Florian Bruhin
ec3ad8a969 Get rid of _warn_on_keychains and _supports_chains 2018-02-27 13:02:32 +01:00
Florian Bruhin
ba012c6ba8 Get rid of BaseKeyparser.Type 2018-02-27 13:01:41 +01:00
Florian Bruhin
b906d92053 Remove now uneeded pylint ignore 2018-02-27 10:06:11 +01:00
Florian Bruhin
72e30cc12c Fix following hints 2018-02-27 09:47:06 +01:00
Florian Bruhin
079fcc7eea Add FIXME 2018-02-27 09:38:40 +01:00
Florian Bruhin
c0e2550046 Fix scripts.keytester 2018-02-27 09:36:56 +01:00
Florian Bruhin
362f923f06 Fix lint 2018-02-27 09:34:55 +01:00
Florian Bruhin
f18b5aa782 Fix searching for blacklisted keys in keyhintwidget 2018-02-27 09:23:06 +01:00
Florian Bruhin
5d581d42f5 Improve key parsing with simple keys containing </> 2018-02-27 09:22:11 +01:00
Florian Bruhin
1ba61bbcbe Fix test_modeparsers 2018-02-27 09:22:01 +01:00
Florian Bruhin
911b2daebf Fix test_keyutils 2018-02-27 09:07:20 +01:00
Florian Bruhin
5a03d31f6f More test_basekeyparser fixes 2018-02-27 08:53:28 +01:00
Florian Bruhin
eeeb763f8a Make sure 0 is handled as command 2018-02-27 08:50:50 +01:00
Florian Bruhin
9e27f2b3e7 Initial attempts at fixing test_basekeyparser 2018-02-27 08:48:16 +01:00
Florian Bruhin
44b4cb92be Make keyutils.KeySequence.parse('') work 2018-02-27 08:35:14 +01:00
Florian Bruhin
ac4fd7c563 Add KeyInfo.to_event() 2018-02-27 08:20:06 +01:00
Florian Bruhin
1e8f72dfe6 Adjust test_configtypes 2018-02-27 08:10:54 +01:00
Florian Bruhin
f40f4082ba Validate configtypes.Key correctly 2018-02-27 07:56:34 +01:00
Florian Bruhin
612387633d Adjust test_configfiles 2018-02-27 07:53:29 +01:00
Florian Bruhin
e8d5fb5cca Normalize keybinding with :bind 2018-02-27 07:51:14 +01:00
Florian Bruhin
214e750c69 Adjust test_configcommands.py 2018-02-27 07:51:07 +01:00
Florian Bruhin
b1f4b1eaba Fix :unbind with already bound keys
The previous change was incorrect and caused a regression (test_unbound_twice)
2018-02-27 07:40:54 +01:00
Florian Bruhin
49f8bc3d63 Use KeySequences correctly in test_config.py 2018-02-27 07:37:55 +01:00
Florian Bruhin
fa29a0b686 Expect capitalized bindings in test_models 2018-02-27 06:58:39 +01:00
Florian Bruhin
1b0aea5e05 Bring simple bindings to front in get_reverse_bindings_for 2018-02-27 06:56:57 +01:00
Florian Bruhin
8416e97c6c Fix type which is stubbed in test_models 2018-02-27 06:50:57 +01:00
Florian Bruhin
93ff9006ad Merge remote-tracking branch 'origin/pr/3643' 2018-02-27 06:24:33 +01:00
Florian Bruhin
bc3e1b316d Use "command -v" instead of "which" in bash scripts
shellcheck recently added SC2330 checking for this. "which" is non-standard, and
not guaranteed by POSIX to have a meaningful exit status, while "command -v" is
specified by POSIX: https://stackoverflow.com/q/592620
2018-02-27 06:23:00 +01:00
Florian Bruhin
53fb5af99c Paste version information privately 2018-02-26 23:09:55 +01:00
Florian Bruhin
01462008c9 Clearly separate yesno/prompt key modes 2018-02-26 22:49:15 +01:00
Florian Bruhin
d9ae3fd5aa Fix more hinting issues 2018-02-26 20:49:02 +01:00
Florian Bruhin
de3b4adfd8 Don't force-follow hints when typing chars 2018-02-26 20:48:49 +01:00
Florian Bruhin
6fc391986f Fix KeyInfo.text() for space 2018-02-26 20:48:22 +01:00
Florian Bruhin
e9d58dae2a Fix getting individual items from KeySequence 2018-02-26 20:48:11 +01:00
Florian Bruhin
9f0e1a98a0 Make hint keybinding inhibition work 2018-02-26 20:22:52 +01:00
Florian Bruhin
8bce2ba8e8 Fix expected message 2018-02-26 20:03:21 +01:00
Florian Bruhin
f1b20f6dc4 Fix forward_unbound_keys test 2018-02-26 20:02:43 +01:00
pyup-bot
416712d2dc Update pytest from 3.4.0 to 3.4.1 2018-02-26 17:04:18 +01:00
pyup-bot
3dedd0d178 Update hypothesis from 3.45.2 to 3.46.0 2018-02-26 17:04:17 +01:00
Florian Bruhin
1444634abb Fix :fake-key test 2018-02-26 14:26:12 +01:00
Florian Bruhin
bb647123b7 Fix invalid key sequences 2018-02-26 14:13:46 +01:00
Florian Bruhin
2698b8bb63 Fix unicodedata check 2018-02-26 13:47:45 +01:00
Florian Bruhin
f15e2285ba Fix bindings.key_mappings 2018-02-26 13:41:01 +01:00
Florian Bruhin
0afaf2ce89 Fix capital chars after string change 2018-02-26 11:48:10 +01:00
Florian Bruhin
508a12a84c Try fixing KeyInfo.__str__ with lower-/uppercase chars 2018-02-26 11:36:24 +01:00
Florian Bruhin
1609e0d445 Fix keyhint widget 2018-02-26 11:16:56 +01:00
Florian Bruhin
16940db834 Refactor KeySequence initialization 2018-02-26 11:16:51 +01:00
Florian Bruhin
f92bb16408 Make config.bind work 2018-02-26 10:38:59 +01:00
Florian Bruhin
9aa37febbe Make hints work 2018-02-26 10:33:18 +01:00
Florian Bruhin
be4cd94207 Try getting hints to work 2018-02-26 10:14:30 +01:00
Florian Bruhin
d077f38ac4 Store multiple QKeySequences in KeySequence 2018-02-26 09:13:53 +01:00
Florian Bruhin
79a337767a Initial work at making :fake-key work 2018-02-26 09:13:44 +01:00
Florian Bruhin
cdf6f52d15 Update changelog
[ci skip]
2018-02-26 08:15:34 +01:00
Florian Bruhin
6f9c62b24a Improve marker descriptions 2018-02-26 07:56:51 +01:00
Florian Bruhin
353753c03c Merge remote-tracking branch 'origin/pr/3620' 2018-02-26 07:26:24 +01:00
Florian Bruhin
de0aa32c11 Merge remote-tracking branch 'origin/pr/3626' 2018-02-26 07:20:34 +01:00
Florian Bruhin
edd2f89d5d Update changelog 2018-02-26 07:16:55 +01:00
Florian Bruhin
bd79d7e071 Merge remote-tracking branch 'origin/pr/3637' 2018-02-26 07:16:19 +01:00
Jay Kamat
76bf35cbdd Add qtbug60673 markers to relevant tests 2018-02-25 19:00:15 -05:00
Jay Kamat
7a8fa5f46e Implement deduplication of searches on webkit 2018-02-25 18:40:16 -05:00
Florian Bruhin
e273f163a6 Add a KeyInfo class 2018-02-25 22:09:39 +01:00
Anton S
eeb565319f Handle invalid URLs on Apple events 2018-02-25 23:58:49 +03:00
Florian Bruhin
321d5c5d20 Merge branch 'master' into keys 2018-02-25 21:25:12 +01:00
Florian Bruhin
3df066c694 Update changelog 2018-02-25 21:10:35 +01:00
Florian Bruhin
54713f57e5 Merge remote-tracking branch 'origin/pr/3624' 2018-02-25 21:09:56 +01:00
Florian Bruhin
a98466336e Update changelog 2018-02-25 19:58:23 +01:00
Florian Bruhin
52b5492c6a Merge branch 'per-url' 2018-02-25 19:44:51 +01:00
Florian Bruhin
ba88fc43e0 Stabilize error page test 2018-02-25 19:40:38 +01:00
Florian Bruhin
abf4d10d5b Add a test for :set -p with a pattern 2018-02-25 19:33:27 +01:00
Florian Bruhin
4c147b77c1 Add a test for the error page workaround 2018-02-25 16:35:02 +01:00
Florian Bruhin
a32d74e983 Fix lint 2018-02-25 16:08:15 +01:00
Florian Bruhin
d44ff5ba01 Don't load the URL immediately on :undo
On some pages like Qt's Gerrit, Indiegogo or Telegram Web, this caused a crash
with QtWebEngine and Qt 5.10.1 in
QtWebEngineCore::WebContentsAdapter::webContents().

I'm not sure what causes the crash exactly, but I'm guessing it's some kind of
race condition between loading the URL initially and deserializing the history,
which both ends up loading the URL.

Since restoring the history means we end up on the given URL anyways, let's just
not open the URL beforehand, which seems to fix this.

Fixes #3619.
2018-02-25 15:55:20 +01:00
Florian Bruhin
97e00ba4b5 Only reload after setting changes when needed
Apparently, things work fine with Type.link_clicked even if we don't emit
predicted_navigation there...
2018-02-25 15:17:03 +01:00
Florian Bruhin
eade305965 Add a predicted_navigation signal
This is emitted when we know that we're going to visit some URL, but Qt doesn't
know yet. This way, we can change the settings early, and since we know which
settings have actually changed, prevent a change needing a reload in
_on_navigation_request.
2018-02-25 15:04:04 +01:00
Florian Bruhin
65a62b67a5 Go back to using tab.openurl on config changes
This seems to work most reliably at the moment...
2018-02-25 14:45:30 +01:00
Florian Bruhin
638e880604 Improve workaround for missing error pages 2018-02-25 14:45:30 +01:00
Florian Bruhin
bfb3a6594f Try using tab.reload() on setting changes instead 2018-02-25 14:45:19 +01:00
Florian Bruhin
08bc55995b First attempt at reloading pages after setting changes 2018-02-25 14:45:09 +01:00
Jay Kamat
4602afe770 Add a webengine duplicate search test 2018-02-23 18:13:20 -05:00
Jay Kamat
820ffed07f Remove test blacklists for 5.10 2018-02-23 18:06:57 -05:00
Jay Kamat
f926e7b850 Emulate webkit duplicate search behavior on webengine 2018-02-23 18:06:21 -05:00
Florian Bruhin
2c96446bb9 Track which settings changed for a URL
This is currently only used so only changed settings are logged, but will used
for more in the next commit.
2018-02-23 18:11:33 +01:00
Florian Bruhin
75b65e2f11 Simplify attribute handling in Web(Kit|Engine)Settings
Let's just have lists in _ATTRIBUTES for WebEngineSettings as well, that allows
us to share some more code.
2018-02-23 17:59:12 +01:00
Florian Bruhin
fc6a0dbe64 Show a simple error page on loading errors without JS
We can't tell what exactly the error is, but it's surely better than nothing.
2018-02-23 17:29:17 +01:00
Florian Bruhin
98b2b67b8b Add tests for per-URL JavaScript settings 2018-02-23 15:08:07 +01:00
Florian Bruhin
3956f81e73 Refactor websettings
This refactors the whole web(kit|engine|) settings mess a bit so there's a
Web(Kit|Engine)Settings object for (non-static) settings set on a
QWeb(Engine)Settings object in Qt. Everything else is set on module-level a bit
less declaratively.

The whole inheritance mess is gone, and we can now also construct a
Web(Kit|Engine)Settings object for a given tab.

Fixes #2701
2018-02-23 09:51:28 +01:00
Florian Bruhin
49ead32f13 Update urlmatch tests for Chromium changes
See:
0ab1294c92%5E%21/
https://bugs.chromium.org/p/chromium/issues/detail?id=812543
2018-02-23 06:31:49 +01:00
Jay Kamat
cb8d62866c Blacklist qt versions 5.8.0 through 5.9.4 for caret tests 2018-02-22 18:34:15 -05:00
Jay Kamat
7ecbae765d Use baseNode over anchorNode in follow-selected
baseNode isn't documented anywhere that I can find, but it seems to be
getting us what anchorNode used to get us.
2018-02-22 16:42:58 -05:00
Jay Kamat
c16c625feb Add basic tests for searching and caret mode 2018-02-22 10:28:35 -05:00
Florian Bruhin
eb4c806ddb Add URL pattern to settings output 2018-02-22 08:07:54 +01:00
Florian Bruhin
5c4277aac8 Add some default keybindings for toggling scripts
Those follow the following pattern:

1) "t" for 'toggle"
2) "s" for "scripts", upper-casing ("S") to make the toggle permanent
3) "h" for host, "H" for host with subdomains, "u" for the exact URL
2018-02-22 08:07:54 +01:00
Jay Kamat
2ffb1604d3 Convert search to blue selection when entering caret mode 2018-02-21 10:01:27 -05:00
Florian Bruhin
ada15510a7 Update changelog 2018-02-21 11:07:55 +01:00
Florian Bruhin
81c17627f7 Merge remote-tracking branch 'origin/pr/3617' 2018-02-21 11:06:52 +01:00
Florian Bruhin
d2e996a3b3 Merge remote-tracking branch 'origin/pr/3610' 2018-02-21 11:06:05 +01:00
Florian Bruhin
d2182edc7a Merge remote-tracking branch 'origin/pr/3603' 2018-02-21 11:03:37 +01:00
Florian Bruhin
ca26d97589 Merge remote-tracking branch 'origin/pr/3599' 2018-02-21 11:02:51 +01:00
Florian Bruhin
13bd4dd05d Clean up version.pastebin_url in pbclient fixture 2018-02-21 10:49:42 +01:00
Florian Bruhin
2fbc7b4e1d Merge remote-tracking branch 'origin/pr/3594' 2018-02-21 10:15:27 +01:00
Florian Bruhin
8b09003bd1 Merge remote-tracking branch 'origin/pr/3592' 2018-02-21 10:13:26 +01:00
Florian Bruhin
ecfd4a77a0 Merge remote-tracking branch 'origin/pr/3562' 2018-02-21 10:11:40 +01:00
Florian Bruhin
cfeeb7460b Add docstrings to ConfigAPI 2018-02-21 09:14:49 +01:00
Florian Bruhin
ea6a5de374 Update FIXMEs 2018-02-20 23:28:11 +01:00
Florian Bruhin
0d4e20c395 Whitelist config options which support URL patterns 2018-02-20 23:26:22 +01:00
Florian Bruhin
6c5876a494 Fix tests broken by urlmatch trailing slash change 2018-02-20 23:08:09 +01:00
Florian Bruhin
5fbd488fdf Only change settings for main-frame navigations 2018-02-20 22:45:29 +01:00
Florian Bruhin
18848315f5 urlmatch: Make it possible to leave off trailing slash 2018-02-20 22:45:16 +01:00
Florian Bruhin
17b235b523 Add error handling for parsing patterns from YAML 2018-02-20 22:29:21 +01:00
Florian Bruhin
46aeb25e7e Fix lint 2018-02-20 20:55:42 +01:00
Florian Bruhin
439d51875f Add config.pattern() 2018-02-20 20:54:26 +01:00
Florian Bruhin
de38566c11 Update configuring.asciidoc with per-domain settings 2018-02-20 18:43:51 +01:00
Florian Bruhin
3ade923edb Add basic pattern support for config.py 2018-02-20 18:43:42 +01:00
gammelon
16218a9900 Remove unnecessary try, rephrase to imperative mood 2018-02-20 18:11:50 +01:00
Florian Bruhin
a3dfec20c1 Rename --url to --pattern 2018-02-20 17:56:47 +01:00
Florian Bruhin
f8b1e7739d Update docs 2018-02-20 17:56:47 +01:00
Florian Bruhin
9685445559 Fix issues with Python 3.5 2018-02-20 17:56:47 +01:00
Florian Bruhin
e482c76874 YamlConfig: Refuse to read a newer config version 2018-02-20 17:08:28 +01:00
Florian Bruhin
03114ccf51 Migrate YAML config files in old format 2018-02-20 16:14:06 +01:00
Florian Bruhin
b3d788fead Add YamlConfig._pop_object 2018-02-20 15:46:05 +01:00
Marco Zollinger
96e8151cce use up to date cheatsheet images from repo instead of qutebrowser.org 2018-02-20 15:18:31 +01:00
Florian Bruhin
9595aaf897 Merge pull request #3614 from qutebrowser/pyup-scheduled-update-2018-02-19
Scheduled weekly dependency update for week 07
2018-02-20 13:48:53 +01:00
Florian Bruhin
f2bba2e4fa Fix navigation handling 2018-02-20 12:30:41 +01:00
Florian Bruhin
ae73215724 Fix lint 2018-02-20 12:30:41 +01:00
Florian Bruhin
b9bb515b3b Add missing configfiles tests 2018-02-20 12:30:41 +01:00
Florian Bruhin
9c42d87e7d Add missing configutils test 2018-02-20 12:30:34 +01:00
Florian Bruhin
05017c83d6 Add more config tests 2018-02-20 12:30:34 +01:00
Florian Bruhin
d511c5436d Remove dead config code 2018-02-20 12:30:34 +01:00
Florian Bruhin
36f3e54e1d Finish configutils tests 2018-02-20 12:30:34 +01:00
Florian Bruhin
19c00ff92a configutils: Clean up comments 2018-02-20 12:30:34 +01:00
Florian Bruhin
63c77a4d76 urlmatch: Fix equality with non-UrlPattern types 2018-02-20 12:30:34 +01:00
Florian Bruhin
685e3ffcfe Fix and test UrlPattern/configutils.Values stringification 2018-02-20 12:30:34 +01:00
Florian Bruhin
145a21449b configutils: Add first tests 2018-02-20 12:30:34 +01:00
Florian Bruhin
50c847562f configutils.Values: Make it possible to pass values 2018-02-20 12:30:34 +01:00
Florian Bruhin
ab02fcb116 configutils.Values: Add __repr__ 2018-02-20 12:30:34 +01:00
Florian Bruhin
316b4b5340 Add new files to PERFECT_FILES 2018-02-20 12:30:34 +01:00
Florian Bruhin
7fcb21573d Update backers file 2018-02-20 08:52:16 +01:00
Florian Bruhin
5978b7b35f config: Improve tests for non-existent options 2018-02-19 22:09:54 +01:00
Florian Bruhin
463320b599 Make test_config.py work 2018-02-19 22:09:54 +01:00
Florian Bruhin
1ada821092 Make sure config options exist 2018-02-19 22:09:54 +01:00
Florian Bruhin
cea664e396 Don't emit changed in unset if unneeded 2018-02-19 22:09:54 +01:00
Florian Bruhin
fecebd6ced Start getting test_config.py to run 2018-02-19 22:09:49 +01:00
Florian Bruhin
7d80825853 Fix test_configfiles.py 2018-02-19 22:09:46 +01:00
Florian Bruhin
ab119975e7 Only emit changed in unset if there was a change 2018-02-19 22:09:46 +01:00
Florian Bruhin
8fead148e2 Add FIXME 2018-02-19 22:09:46 +01:00
Florian Bruhin
1409f4e564 Fix migration of tabs.persist_mode_on_change 2018-02-19 22:09:46 +01:00
Florian Bruhin
5d63dfb24c Start fixing test_configfiles.py 2018-02-19 22:09:46 +01:00
Florian Bruhin
19148a4593 Fix :config-unset 2018-02-19 22:09:46 +01:00
Florian Bruhin
615c6ffe5a Make :config-write-py work again 2018-02-19 22:09:46 +01:00
Florian Bruhin
0f907b1a77 Fix getting YAML values in test_configcommands.py 2018-02-19 22:09:46 +01:00
Florian Bruhin
75181e16fa Fix test_models.py
The Config object got initialized via the config_stub fixture early, so we need
to force it to re-init its values after patching configdata.DATA.
2018-02-19 22:09:46 +01:00
Florian Bruhin
19f7b92abb Fix test_configinit.py 2018-02-19 22:09:43 +01:00
Florian Bruhin
c89e804653 Fix handling of invalid types in YamlConfig 2018-02-19 22:08:42 +01:00
Florian Bruhin
87e329aee3 Fix config.dump_userconfig() with defaults 2018-02-19 22:08:42 +01:00
Florian Bruhin
5eeb223338 Use a different directory for file prompt tests
This way they aren't influenced by the config_tmpdir fixture.
2018-02-19 22:08:42 +01:00
Florian Bruhin
f43c7fa360 Fix changing values in configutils.Values 2018-02-19 22:08:42 +01:00
Florian Bruhin
d3e8d46593 Use a real YamlConfig for tests 2018-02-19 22:08:42 +01:00
Florian Bruhin
cb631d532a Fix getting global value from configutils.Values 2018-02-19 22:08:42 +01:00
Florian Bruhin
8b666d2d2e Try to update settings in acceptNavigationRequest
This still doesn't seem to update them early enough?
2018-02-19 22:08:42 +01:00
Florian Bruhin
bd6e99158e Get rid of the second deepcopy for config values
There were two reasons why we deepcopy mutable objects in the config:

1) So mutations don't mess with our internal/default values.
2) So we can detect mutations and update the config.

If we're going to copy the value for 1) in maybe_copy(), we know the original
value is not going to be mutated, so we can use that directly for self._mutables
instead of making another copy.
2018-02-19 22:07:53 +01:00
Florian Bruhin
93972ff3f1 Copy value before watching it for mutations in config
If we copy it afterwards, we are going to mutate the copied object.
2018-02-19 22:07:53 +01:00
Florian Bruhin
ddb914dc65 Refactor YAML init 2018-02-19 22:07:53 +01:00
Florian Bruhin
8504ad6ff3 Change how iterating over Config/YamlConfig works 2018-02-19 22:07:53 +01:00
Florian Bruhin
6abb42a066 Make saving in autoconfig.yml work 2018-02-19 22:07:53 +01:00
Florian Bruhin
4691753965 Avoid running change handlers on config.clear 2018-02-19 22:07:53 +01:00
Florian Bruhin
9c670e13ce Make clearing config work 2018-02-19 22:07:53 +01:00
Florian Bruhin
a6b979539d Add missing configutils.py 2018-02-19 22:07:53 +01:00
Florian Bruhin
14a69d9047 Fix lint 2018-02-19 22:07:53 +01:00
Florian Bruhin
7c1fb1d215 Refactor acceptNavigationRequest handling to use signals 2018-02-19 22:07:53 +01:00
Florian Bruhin
2a7998847f Unset values properly 2018-02-19 22:07:53 +01:00
Florian Bruhin
74a7676111 Fix issues with per-domain proof-of-concept 2018-02-19 22:07:53 +01:00
Florian Bruhin
d09afdf0ee Refactor handling of mutables with url/pattern in Config
This also should not copy stuff coming from the config if it's not needed.
2018-02-19 22:07:53 +01:00
Florian Bruhin
8551288efb Start working on different per-URL storage 2018-02-19 22:07:53 +01:00
Florian Bruhin
5e50824042 Broken per-URL proof-of-concept 2018-02-19 22:07:53 +01:00
Florian Bruhin
4ed07d6062 Initial implementation of per-URL setting storage 2018-02-19 22:07:53 +01:00
Florian Bruhin
894da598d6 urlmatch: Remove dead code 2018-02-19 22:07:53 +01:00
Florian Bruhin
7033af816a urlmatch: Add equality testcases 2018-02-19 22:07:53 +01:00
Florian Bruhin
eda15c53ad urlmatch: Improve port error output 2018-02-19 22:07:53 +01:00
Florian Bruhin
d6ea9b1e47 urlmatch: Add test for invalid IPv6 URL 2018-02-19 22:07:53 +01:00
pyup-bot
8a0be83e1e Update pytest-mock from 1.6.3 to 1.7.0 2018-02-19 17:04:13 +01:00
pyup-bot
11579b3511 Update hypothesis from 3.44.26 to 3.45.2 2018-02-19 17:04:12 +01:00
bttner
e169e2165d Refactor TabbedBrowser from inheritance to composition 2018-02-19 14:29:05 +01:00
Jay Kamat
84907d5a2e Simplify readability logic using get defaults
:D
2018-02-18 14:49:09 -05:00
Jay Kamat
c844023077 Use QUTE_DATA_DIR in readability userscript 2018-02-18 14:28:46 -05:00
Florian Bruhin
ab0034f9da Merge pull request #3607 from rasa/patch-1
Add scoop installer
2018-02-18 11:30:25 +01:00
Ross Smith II
bf72d81bd3 Add scoop installer
See https://github.com/lukesampson/scoop-extras/pull/783
2018-02-18 00:07:02 -08:00
jnphilipp
60a7e483af Add import error message for stem. 2018-02-17 19:57:44 +01:00
gammelon
42ac3dcda0 Add Option url.open_base_url
when set to true, invoking a searchengine shortcut without argument
opens the baseurl of that searchengine instead of DEFAULT searchengine
2018-02-17 11:21:22 +01:00
jnphilipp
6219119476 Update output. 2018-02-17 09:48:39 +01:00
Marc Jauvin
872cff2ae1 make sure tab is not None either, had a crash because of this 2018-02-16 14:03:11 -05:00
jnphilipp
3ee765869d Add tor_identity userscript. 2018-02-16 14:22:08 +01:00
Florian Bruhin
174dd5dd9e urlmatch: Remove performance FIXME 2018-02-15 18:47:07 +01:00
Florian Bruhin
5f6c8435a4 urlmatch: Add initial benchmark/hypothesis test 2018-02-15 18:47:07 +01:00
Florian Bruhin
41b7ac27d7 urlmatch: Postpone checking scheme 2018-02-15 18:47:07 +01:00
Florian Bruhin
5627a63265 urlmatch: Fix lint 2018-02-15 18:47:07 +01:00
Florian Bruhin
e161458f91 urlmatch: Add test cases for oddballs 2018-02-15 18:47:07 +01:00
Florian Bruhin
33b7c4bdd0 urlmatch: Fix and test port handling 2018-02-15 18:47:07 +01:00
Florian Bruhin
45cc1aaeb0 urlmatch: Add tests for file:// 2018-02-15 18:47:07 +01:00
Florian Bruhin
a2836ba945 urlmatch: Make sure URLs are valid 2018-02-15 18:47:07 +01:00
Florian Bruhin
0a10a4f751 urlmatch: Add more tests for special schemes 2018-02-15 18:47:07 +01:00
Florian Bruhin
084d3de65b urlmatch: Add support for data: and javascript: 2018-02-15 18:47:07 +01:00
Florian Bruhin
dae164abee urlmatch: Get rid of scheme whitelist
There are more schemes like data: or javascript:, and we don't want to restrict
schemes anyways.
2018-02-15 18:47:03 +01:00
Florian Bruhin
28aadc4f96 urlmatch: Add tests for <all_urls> 2018-02-15 18:47:03 +01:00
Florian Bruhin
867f2a8e2b urlmatch: Use None for match-all path 2018-02-15 18:47:03 +01:00
Florian Bruhin
8fd0690959 urlmatch: Fix handling of *:// as scheme 2018-02-15 18:47:03 +01:00
Florian Bruhin
a8a9cdd81e urlmatch: Add more tests from Chromium 2018-02-15 18:47:03 +01:00
Florian Bruhin
978b90b5b1 urlmatch: Implement correct IP matching 2018-02-15 18:47:03 +01:00
Florian Bruhin
2d43a1d2e7 urlmatch: Use None as default for host 2018-02-15 18:47:03 +01:00
Florian Bruhin
5419d1caa1 urlmatch: Add glob escaping tests 2018-02-15 18:47:03 +01:00
Florian Bruhin
9092c3a87f urlmatch: Increase debuggability 2018-02-15 18:47:03 +01:00
Florian Bruhin
faeca30dfa urlmatch: Add more tests 2018-02-15 18:47:03 +01:00
Florian Bruhin
b7c3c10b87 urlmatch: Use class in test 2018-02-15 18:47:03 +01:00
Florian Bruhin
a8a976b324 urlmatch: Simplify/fix matching by using None as sentinel 2018-02-15 18:47:03 +01:00
Florian Bruhin
2b274f8e0b urlmatch: Implement initial matching 2018-02-15 18:47:02 +01:00
Florian Bruhin
3d6cbcf396 urlmatch: Improve matching error for TLD wildcards 2018-02-15 18:47:02 +01:00
Florian Bruhin
fa329c698e urlmatch: Finish port parsing 2018-02-15 18:47:02 +01:00
Florian Bruhin
a2a95f5fee urlmatch: Improve port handling 2018-02-15 18:47:02 +01:00
Florian Bruhin
d266190518 urlmatch: Improve port tests 2018-02-15 18:47:02 +01:00
Florian Bruhin
c728d78bea urlmatch: Host/port parsing 2018-02-15 18:47:02 +01:00
Florian Bruhin
32abb67d1f urlmatch: Use dedicated ParseError exception 2018-02-15 18:47:02 +01:00
Florian Bruhin
3c17bb97c0 urlmatch: Start with port parsing 2018-02-15 18:47:02 +01:00
Florian Bruhin
1b8dfb6c36 urlmatch: Disallow NUL byte
See https://bugs.chromium.org/p/chromium/issues/detail?id=390624
With Qt, we might run into the same issue as well at some point, and it sure
can't hurt to disallow it.
2018-02-15 18:46:58 +01:00
Florian Bruhin
76efba296f urlmatch: Store path/port 2018-02-15 18:46:55 +01:00
Florian Bruhin
b93c0dad5a urlmatch: Start UrlPattern 2018-02-15 18:46:51 +01:00
Florian Bruhin
541abb2324 Merge pull request #3602 from jgkamat/jay/js-linkfix
Fix broken language links in contributing
2018-02-14 17:49:53 +01:00
Jay Kamat
12d74c5b52 Fix broken language links in contributing 2018-02-14 11:40:51 -05:00
Marc Jauvin
620a966d1e add debug logs and adjust tests to use them 2018-02-14 09:58:23 -05:00
Marc Jauvin
b791dd3eb4 no restore while in prompt modes on tab change 2018-02-14 09:44:40 -05:00
Marc Jauvin
8a3049f09b make sure there IS a current widget before using it 2018-02-14 08:33:32 -05:00
Marc Jauvin
9b8a182a78 history-clear does nothing to help here 2018-02-13 17:03:01 -05:00
Marc Jauvin
f94e12008a fix the tests by clearing history 2018-02-13 16:23:56 -05:00
George Edward Bulmer
1893a33708 Monkeypatch qapp.launch_time too 2018-02-13 20:51:18 +00:00
George Edward Bulmer
29ff4259d6 Add test for _uptime() 2018-02-13 20:09:19 +00:00
Jonathan Berglind
681bb058fa Use HTTPStatus enum instead of http.client in webserver fixture 2018-02-13 20:57:05 +01:00
Jonathan Berglind
3d5bba9cff Use HTTPStatus in flask test server 2018-02-13 20:57:05 +01:00
Jonathan Berglind
81acba4700 Use HTTPStatus for existing tests, add more ones
Add tests for endpoints being refactored
2018-02-13 20:56:59 +01:00
George Edward Bulmer
ca8d935cf4 Update tests as per code review 2018-02-13 18:38:27 +00:00
Marc Jauvin
e38df261cb skip this test for qt>=5.10 until the log problem gets resolved 2018-02-13 13:00:44 -05:00
George Edward Bulmer
cfa779ecb7 Add trivial test for _uptime 2018-02-13 16:02:20 +00:00
George Edward Bulmer
b959e885fc Pylint fix 2018-02-13 15:25:40 +00:00
George Edward Bulmer
e349af7524 Fix testing with error pastebin_version() 2018-02-13 14:49:15 +00:00
Jay Kamat
6eeacfe82b Fix caret being cleared when leaving any mode 2018-02-13 09:27:15 -05:00
George Edward Bulmer
942dca3444 Add test for pastebin_version() 2018-02-13 13:31:27 +00:00
Florian Bruhin
171392b582 Update changelog 2018-02-13 09:44:10 +01:00
Florian Bruhin
9bf5ff1583 Merge remote-tracking branch 'origin/pr/3584' 2018-02-13 09:43:44 +01:00
Florian Bruhin
0e87c46849 Remove unused win_id argument 2018-02-13 09:43:21 +01:00
Marc Jauvin
fbb78f1133 hook into modeman's entered and left signals
- save previous mode when a prompt is shown
- restore previous mode when finished prompting
2018-02-12 21:57:53 -05:00
Ryan Roden-Corrent
22d7490126 Remove unused import and TODO from urlmarks test. 2018-02-12 19:25:24 -05:00
Marc Jauvin
6214c38d7e add input_mode tests for tabs.mode_on_change 2018-02-12 18:11:32 -05:00
Marc Jauvin
d04fc29163 save input_mode when entering/leaving mode
instead of when changing tab
2018-02-12 18:10:22 -05:00
Florian Bruhin
0fae611021 Update changelog 2018-02-12 23:00:55 +01:00
Florian Bruhin
47451aa495 Open qute://tabs with :buffer 2018-02-12 23:00:26 +01:00
Florian Bruhin
9f163d90e1 Merge remote-tracking branch 'origin/pr/3450' 2018-02-12 22:54:43 +01:00
Simon Doppler
ca199b0d3d Use separate variable to make pylint happy 2018-02-12 22:51:36 +01:00
Simon Doppler
7ae0d584e6 Add 20px margin above the raw list 2018-02-12 22:49:02 +01:00
Simon Doppler
0b047e3e10 Handle url with trailing slash and without 2018-02-12 22:48:41 +01:00
Florian Bruhin
15fd552616 Update changelog 2018-02-12 22:32:11 +01:00
Simon Doppler
9a0c113f8a Fix pylint line-too-long error 2018-02-12 22:25:21 +01:00
Florian Bruhin
1913012c8a Merge remote-tracking branch 'origin/pr/3561' 2018-02-12 22:18:49 +01:00
Florian Bruhin
5f393ce312 Merge remote-tracking branch 'origin/pr/3588' 2018-02-12 22:17:17 +01:00
Florian Bruhin
54bc22dfd4 hostblock_blame: Decode lines properly 2018-02-12 22:16:41 +01:00
Florian Bruhin
deb9ccb564 hostblock_blame: Remove unused import 2018-02-12 22:16:30 +01:00
Florian Bruhin
eca1fb7d3b Update hostblock_blame.py for new config 2018-02-12 17:54:34 +01:00
Florian Bruhin
80a72604c6 Revive hostblock_blame.py 2018-02-12 17:49:20 +01:00
pyup-bot
7fe9f53c97 Update pytest-xvfb from 1.0.0 to 1.1.0 2018-02-12 17:01:33 +01:00
pyup-bot
301aaf5783 Update pytest-faulthandler from 1.3.1 to 1.4.1 2018-02-12 17:01:32 +01:00
pyup-bot
3aa59ea240 Update hypothesis from 3.44.25 to 3.44.26 2018-02-12 17:01:30 +01:00
pyup-bot
bd83ff2c64 Update isort from 4.3.2 to 4.3.4 2018-02-12 17:01:28 +01:00
pyup-bot
e74995e81a Update isort from 4.3.2 to 4.3.4 2018-02-12 17:01:27 +01:00
pyup-bot
75e65b9d4a Update setuptools from 38.5.0 to 38.5.1 2018-02-12 17:01:25 +01:00
pyup-bot
a31f775d70 Update flake8-debugger from 3.0.0 to 3.1.0 2018-02-12 17:01:24 +01:00
pyup-bot
a506788f4f Update coverage from 4.5 to 4.5.1 2018-02-12 17:01:22 +01:00
pyup-bot
f64f873c11 Update coverage from 4.5 to 4.5.1 2018-02-12 17:01:21 +01:00
Simon Doppler
572257921d Use QUrl().toDisplayString() instead of url() 2018-02-12 16:12:15 +01:00
Simon Doppler
417200fa70 Use QUrl instead of str to compare 2018-02-12 16:06:17 +01:00
Simon Doppler
d6912be223 Update import order 2018-02-12 16:04:48 +01:00
Simon Doppler
ee57c30c53 Re-add the raw list (with fixed alignment) 2018-02-12 16:02:06 +01:00
Simon Doppler
0caa5d04d3 Use tabs directly
also ignore tabs page url in list
2018-02-12 15:50:56 +01:00
Florian Bruhin
c736cdf87f Merge remote-tracking branch 'origin/pr/3587' 2018-02-12 15:31:45 +01:00
Florian Bruhin
e66588f818 Update changelog 2018-02-12 15:30:47 +01:00
George Edward Bulmer
9397cc74c1 Pylint indentation fix 2018-02-12 14:24:53 +00:00
George Edward Bulmer
561e5d17b9 Remove extraneous space 2018-02-12 14:22:25 +00:00
Simon Doppler
71d33a47b3 Remove useless intermediary variables 2018-02-12 15:20:41 +01:00
Simon Doppler
ad50a7bfd2 Move import to external ressources 2018-02-12 15:20:06 +01:00
George Edward Bulmer
5b718446b6 Add test for sourcing config with invalid source 2018-02-12 14:19:18 +00:00
George Edward Bulmer
b59a7cdcc0 Report syntax errors as unhandled exceptions
Update tests accordingly
2018-02-12 14:07:05 +00:00
George Edward Bulmer
ce8b457bac Only display exception type if no traceback
Update test to match
2018-02-12 13:43:22 +00:00
Marc Jauvin
68b12e6e9f add missing lines 2018-02-12 07:31:02 -05:00
Marc Jauvin
0a9c0a1385 on_load_finished() signal handler for scroll-pos
remove get_page()
2018-02-12 07:16:01 -05:00
Marc Jauvin
a0e028a851 Update tab scroll position when finished loading.
Resolves #3322
2018-02-11 22:32:03 -05:00
George Edward Bulmer
164b2a3eef Fix a lengthy line 2018-02-11 23:20:24 +00:00
George Edward Bulmer
72103ec730 Format error type in a different way 2018-02-11 23:16:04 +00:00
Ryan Roden-Corrent
d0ca54a0cf Add unit tests for urlmarks. 2018-02-11 16:40:20 -05:00
Ryan Roden-Corrent
4a8b23380c Trigger save on bookmark-add --toggle.
The toggle option was failing to fire the changed signal when it removed
a bookmark. This means the bookmark file would not be marked as dirty,
and would not be saved on exit/autosave (unless another change was
made).
2018-02-11 16:33:00 -05:00
Simon Doppler
ddc41d2fa4 Remove raw list of open tabs 2018-02-11 22:15:14 +01:00
George Edward Bulmer
21a50cf961 Use the repr() of the exception instead of str() 2018-02-11 17:46:09 +00:00
George Edward Bulmer
b2e85a8b83 Simplify to lambda with default argument 2018-02-11 16:33:26 +00:00
Florian Bruhin
3170e35b31 Simplify QtWebKit scheme handlers 2018-02-11 17:14:41 +01:00
George Edward Bulmer
7c0832daf2 Change lambda definition - avoid mutability error 2018-02-11 15:51:48 +00:00
Florian Bruhin
c112290664 Make QtNetwork download manager great^H^H^H^Hlobal again
We originally made it per-window in b502280c06 for
issue #228, but that was back when we still needed window IDs for stuff like
message.info.

Nowadays, there's no reason for it to be per-window anymore. The rest of the
download code can deal with one global download manager (because QtWebEngine has
one), and apart from QNAM code which wasn't used here anyways (as tab_id=None)
there was nothing using the window ID anymore.

Also see #3456 which was the original motivation for this change.
2018-02-11 16:15:29 +01:00
George Edward Bulmer
2f4910f1f2 Add test for escaping {{url}} 2018-02-11 14:17:28 +00:00
Florian Bruhin
e10940100d Improve/regenerate docs 2018-02-11 11:17:37 +01:00
Florian Bruhin
9c4564fd70 Merge remote-tracking branch 'origin/pr/3581' 2018-02-11 11:16:20 +01:00
Florian Bruhin
5510c5fda1 Update changelog 2018-02-11 11:14:50 +01:00
Florian Bruhin
0743094c2f Fix copyright year in __init__.py 2018-02-11 11:12:39 +01:00
Florian Bruhin
32ba5a5c95 Improve styling for qute://version and move button 2018-02-11 11:11:55 +01:00
Florian Bruhin
ab768d6f6a Merge remote-tracking branch 'origin/pr/3567' 2018-02-11 11:11:41 +01:00
Florian Bruhin
b7f54a89db Update changelog 2018-02-11 10:46:45 +01:00
Florian Bruhin
bba1eb0d76 Add missing QUrl.RemovePassword 2018-02-11 10:45:08 +01:00
Florian Bruhin
d306f81130 Merge remote-tracking branch 'origin/pr/3525' 2018-02-11 10:44:27 +01:00
Florian Bruhin
007aa8ab8d Add some newlines 2018-02-11 10:35:46 +01:00
Florian Bruhin
e53cf08548 Update changelog 2018-02-11 10:35:31 +01:00
Florian Bruhin
772f0025f1 Clean up netrc support 2018-02-11 10:29:02 +01:00
Florian Bruhin
b64eb8dfe6 Merge remote-tracking branch 'origin/pr/3505' 2018-02-11 10:27:00 +01:00
Florian Bruhin
4e77aa41d8 Update changelog 2018-02-11 09:39:33 +01:00
Florian Bruhin
f28ab5285c Merge remote-tracking branch 'origin/pr/3582' 2018-02-11 09:37:49 +01:00
Jay Kamat
f6eb8929c3 Fix incorrect scroll offset after tab pin 2018-02-11 00:20:39 -05:00
Florian Bruhin
70868e1d99 Make pylint shut up 2018-02-10 23:18:43 +01:00
Florian Bruhin
219b75524b Fix TestCreatingDir on non-Linux 2018-02-10 23:08:47 +01:00
Florian Bruhin
a472351423 Fix typing.Union check on Python 3.5.2
Apparently 3.5.4 has __origin__ for typing.Union, but 3.5.2 has not. Let's hope
this now works everywhere...
2018-02-10 21:27:40 +01:00
Jay Kamat
11e04c79f4 Add add/remove tests to benchmarks 2018-02-10 15:10:33 -05:00
Florian Bruhin
52d7ff79fc Skip another scroll test with Qt 5.10 and Travis 2018-02-10 20:15:17 +01:00
Florian Bruhin
f25e706e11 Add Python 3.7 compatibility to setup.py 2018-02-10 20:08:33 +01:00
Florian Bruhin
5f62c016cc Fix test_standarddir.TestCreatingDir
What we actually want to test here is that the given type directory is created
and has the correct permission, we don't care much about the basedir itself.

Also, the download dir is not created automatically.

This test failed on Python 3.7 because intermediate directories now aren't
created with the given mode anymore:

https://bugs.python.org/issue19930
https://docs.python.org/3.7/whatsnew/3.7.html#changes-in-the-python-api
2018-02-10 20:07:27 +01:00
Florian Bruhin
cd1bd7d52a Skip ASCII locale tests with Python 3.7 2018-02-10 19:58:30 +01:00
Florian Bruhin
5b22209eef Run test_init_benchmark on CI again
See #2777
2018-02-10 19:50:20 +01:00
Florian Bruhin
aa5da1b312 Don't set up YAML constructors/resolvers for default loaders
After reading https://pyyaml.org/wiki/PyYAMLDocumentation again, turns out
Loader.add_constructor and .add_implicit_resolver are actually *class* methods.

In other words, we've been adding dozens of constructors/resolvers to the
default YAML loader object, causing it to slow down massively in other tests
which call configdata.init().

Instead, create our own loader class and only add them once there.

I'm still not sure why this caused the duration to increase with every YAML load
though - that might still be some kind of bug in PyYAML.

Fixes #2777
2018-02-10 19:35:03 +01:00
Jay Kamat
33d9d4fe90 Improve performance of startup and shutdown
We call 'update_tab_titles' a lot of times which calls 'setTabText' on
every tab. 'setTabText' calls tabSizeHint and minTabSizeHint on every
tab as well, meaning this is an n^2 operation repeated many times.

First, this prevents setTabText from being called unless it's needed,
removing most of the work done.

Second, I remove tabs in reverse, to avoid recomputing the above for
every tab on shutdown (which is at least n^3)
2018-02-10 13:23:35 -05:00
Florian Bruhin
63766c1711 Fix typing.Union checks with Python 3.7 2018-02-10 17:22:21 +01:00
Florian Bruhin
80ee43beca Add Python 3.7 to tox.ini 2018-02-10 16:54:55 +01:00
Florian Bruhin
c9bc72a539 Fix docstring 2018-02-10 16:54:45 +01:00
George Edward Bulmer
a6f09b1f73 Add the modified keys with a loop 2018-02-10 15:41:02 +00:00
Florian Bruhin
015889373e Update docs 2018-02-10 16:28:34 +01:00
Florian Bruhin
6d750aff8b Merge remote-tracking branch 'origin/pr/3430' 2018-02-10 16:27:41 +01:00
George Edward Bulmer
ffddf9a15f Code style review changes 2018-02-10 15:14:07 +00:00
Marc Jauvin
e6749dcf9f [count] overrides win_id for tab-give cmd
- Resolves #3548
2018-02-10 10:13:07 -05:00
Marc Jauvin
e8cc74f499 Merge branch 'master' into issue#2785 2018-02-10 08:17:47 -05:00
rnhmjoj
6f9be72c5b Update tests for statusbar changes 2018-02-10 13:15:12 +01:00
rnhmjoj
715cc7b7dd Make statusbar widgets configurable 2018-02-10 13:15:11 +01:00
Florian Bruhin
5662407e01 Update docs 2018-02-10 11:53:52 +01:00
Florian Bruhin
4ac4833c93 Clean up YamlConfig._handle_migrations 2018-02-10 11:44:18 +01:00
Florian Bruhin
c7133a662c Merge remote-tracking branch 'origin/pr/3577' 2018-02-10 11:40:49 +01:00
Florian Bruhin
11a0580e64 Fix Qt spelling 2018-02-10 10:41:57 +01:00
Florian Bruhin
8d5c0b5fa2 Merge remote-tracking branch 'origin/pr/3565' 2018-02-10 10:41:38 +01:00
Florian Bruhin
4e4a1d01c4 Remove qutebrowser_viewsource userscript
:view-source --edit can now be used instead.
2018-02-10 10:37:05 +01:00
Florian Bruhin
995e563352 Update docs 2018-02-10 10:36:58 +01:00
Florian Bruhin
92bc61d08d Merge remote-tracking branch 'origin/pr/3563' 2018-02-10 10:19:52 +01:00
Marc Jauvin
c6ad23f921 address all mentionned issues except for file://
- re-encode url using QUrl.RemovePassword | QUrl.FullyEncoded
- improve readability for clipboard / primary selection code block
2018-02-10 00:38:27 -05:00
Marc Jauvin
504e29c004 fix configfiles tests
- fix test_renamed_key()
- fix test_deleted_key()
- combine both test_merge_persist tests using @pytest.mark.parametrize
- fix _handle_migrations(): mark data dirty for renamed and deleted
2018-02-09 21:25:11 -05:00
Marc Jauvin
d88a13598a syntax improvements and use real class attributes 2018-02-09 17:14:40 -05:00
Florian Bruhin
b648345bf8 Update changelog 2018-02-09 22:50:36 +01:00
Florian Bruhin
47ec052194 Merge remote-tracking branch 'origin/pr/3558' 2018-02-09 22:50:00 +01:00
Florian Bruhin
3779f59a23 Update changelog 2018-02-09 22:48:51 +01:00
Florian Bruhin
30994b1154 Merge remote-tracking branch 'origin/pr/3555' 2018-02-09 22:48:25 +01:00
Florian Bruhin
207107082d Merge commit '74759fe04c0fa1d465cb36d3f8b00d6ebd9ef49d' 2018-02-09 22:31:34 +01:00
Florian Bruhin
c82be35639 Update changelog 2018-02-09 22:29:40 +01:00
Florian Bruhin
16a3bece34 Add missing import 2018-02-09 22:28:14 +01:00
Florian Bruhin
1ea1c1ac78 Merge remote-tracking branch 'origin/pr/3549' 2018-02-09 22:27:31 +01:00
Florian Bruhin
1ed427c342 Update changelog 2018-02-09 22:27:05 +01:00
Florian Bruhin
7058a3be74 Regenerate docs 2018-02-09 22:25:39 +01:00
Florian Bruhin
0b5ba828db Add missing test 2018-02-09 22:23:07 +01:00
Florian Bruhin
3a5baa1956 Merge remote-tracking branch 'origin/pr/3554' 2018-02-09 22:22:18 +01:00
Marc Jauvin
74759fe04c add missing decorator to _on_proc_finished 2018-02-09 15:33:02 -05:00
Marc Jauvin
9f49ac8e59 revert "fix shorten line" from origin/master 2018-02-09 15:25:20 -05:00
Marc Jauvin
57fe674dc4 shorten lines 2018-02-09 15:22:56 -05:00
Florian Bruhin
80650d4c96 Merge remote-tracking branch 'origin/pr/3544' 2018-02-09 21:04:21 +01:00
Marc Jauvin
44af6f3f1b Merge branch 'master' of https://github.com/qutebrowser/qutebrowser into tabs.mode_on_change 2018-02-09 14:57:41 -05:00
Marc Jauvin
9b7db8ee8a Need to mark config as dirty in _handle_migrations()
Add tests for tabs.persist_mode_on_change migration
2018-02-09 14:41:33 -05:00
Marc Jauvin
4e2e2606ef Merge branch 'tab-input-mode-patch' of https://github.com/mjauvin/qutebrowser into new--tab-input-mode 2018-02-09 12:28:40 -05:00
Marc Jauvin
85dfe5c403 add special code to migrate tabs.persist_mode_on_change setting to tabs.mode_on_change. 2018-02-09 11:28:21 -05:00
Marc Jauvin
a3ce03e0bd address requested changes
- syntax cleanup
- use attr.ib when declaring class attributes
- remove unnecessary comments
- code simplification
2018-02-09 10:39:02 -05:00
Marc Jauvin
fecb551c5e shorten lines 2018-02-09 10:39:02 -05:00
Marc Jauvin
91b70fab70 fix pylint/flake8 errors 2018-02-09 10:39:02 -05:00
Marc Jauvin
f3b52aaf23 fix asciidoc for tabs.mode_on_change 2018-02-09 10:39:02 -05:00
Marc Jauvin
21fc848839 document code a bit more 2018-02-09 10:39:02 -05:00
Marc Jauvin
a7db197e45 replace persist_mode_on_change with mode_on_change
supports old persist_mode_on_change functionality or new save/restore mode
2018-02-09 10:39:02 -05:00
Marc Jauvin
eb7e114e5f add propery to save tab input mode 2018-02-09 10:39:02 -05:00
Marc Jauvin
9e524e4be8 use tabs.mode_on_change to persist or restore mode 2018-02-09 10:39:02 -05:00
Florian Bruhin
5d8b48a2ed Show where a command handler is defined 2018-02-09 16:32:59 +01:00
Florian Bruhin
89bd723eaa Add scripts/*.js to MANIFEST.in 2018-02-09 13:18:12 +01:00
Florian Bruhin
7caab75fa4 Clean up cycle-inputs.js 2018-02-09 12:14:07 +01:00
Florian Bruhin
8c3039abc9 Merge remote-tracking branch 'origin/pr/3452' 2018-02-09 12:13:30 +01:00
Florian Bruhin
3e38aab0f6 Document configdata.Migrations 2018-02-09 11:31:25 +01:00
Florian Bruhin
589605fe92 Fix lint 2018-02-09 10:39:16 +01:00
Florian Bruhin
f92b52b20c Update changelog 2018-02-09 10:38:42 +01:00
Florian Bruhin
1a81f7231b Make sure multiple wrong keys are reported 2018-02-08 22:02:22 +01:00
Florian Bruhin
1a88b64c67 Add a test for keyconfig.get_command(..., default=True) 2018-02-08 21:53:41 +01:00
Florian Bruhin
298dcb4c90 Validate config separately from migrations
It makes for cleaner code, and it makes sure the target of renamed options
actually exists.
2018-02-08 21:49:41 +01:00
Florian Bruhin
e0dd7970d8 Skip fragment test
Looks like this now XPASSes with Qt 5.10 on Windows
2018-02-08 20:23:34 +01:00
Florian Bruhin
ea80ded8d5 Try to stabilize editor end2end test
Let's also wait until we're sure the mtime changed here.
2018-02-08 20:21:25 +01:00
George Edward Bulmer
950e4227e3 Pylint fix 2018-02-08 14:01:51 +00:00
Florian Bruhin
15fecc962d Fix lint 2018-02-08 11:41:58 +01:00
Florian Bruhin
53e7d13c2d Skip failing scrolling tests on Qt 5.10 on Travis
See #3572
2018-02-08 10:42:55 +01:00
Florian Bruhin
c520130389 Add tests for a failing watch/unwatch 2018-02-08 10:29:23 +01:00
Florian Bruhin
9d32807e33 Don't try to remove watched files if none exist
If we try to remove watched files but we couldn't actually watch any earlier,
we'd get a Qt warning message:

QtWarningMsg: QFileSystemWatcher::removePaths: list is empty
2018-02-08 10:29:17 +01:00
Florian Bruhin
1da58b6a4c Break long line 2018-02-08 09:54:20 +01:00
Florian Bruhin
b6f311f4b2 Remove workaround for old pylint issue 2018-02-08 09:52:14 +01:00
Florian Bruhin
35b56f2659 Remove eslint max-lines suppression
We already turn that off globally now.
2018-02-08 09:51:06 +01:00
Florian Bruhin
f51ac8ab6e Log QFileSystemWatcher errors 2018-02-08 00:32:02 +01:00
George Edward Bulmer
a9dfed948a Remove extraneous function 2018-02-07 22:55:42 +00:00
Florian Bruhin
37a9691e29 Only focus qutebrowser again after editing finished
See #3431, #3432
2018-02-07 23:14:16 +01:00
Florian Bruhin
3306247ae5 Merge branch 'editor-watch' 2018-02-07 22:31:49 +01:00
Florian Bruhin
cd97d5e6e2 Update changelog 2018-02-07 22:31:28 +01:00
Florian Bruhin
01ccbc679d Fix lint 2018-02-07 22:26:32 +01:00
Florian Bruhin
abd56a5abd Wait until the mtime changed 2018-02-07 21:40:03 +01:00
George Edward Bulmer
0ee5302836 Pylint fixes 2018-02-07 20:03:46 +00:00
George Edward Bulmer
682c3462f1 Ensure version info only gets pasted once 2018-02-07 19:21:53 +00:00
George Edward Bulmer
9128afa01d Move pastebin_version() to version.py
This also fixes the introduced cyclic dependencies
2018-02-07 19:03:05 +00:00
George Edward Bulmer
a3d62c86df Fix style for linter 2018-02-07 17:28:57 +00:00
George Edward Bulmer
d0ec33730e Add deleteLater to the paste callbacks 2018-02-07 17:28:57 +00:00
George Edward Bulmer
86d3abc0c4 Additional code review changes from PR #3480 2018-02-07 17:28:57 +00:00
George Edward Bulmer
f45d572677 Some style fixes in PR #3480's review 2018-02-07 17:28:57 +00:00
Bryan Kok
1d568a5cf4 Add feature to pastebin version string
Added a --paste flag to the :version command and a JS button with corresponding qutescheme URL in the Version debug page to enable pastebinning version.
2018-02-07 17:28:57 +00:00
Florian Bruhin
7dbe9a59e8 Update changelog 2018-02-07 18:26:43 +01:00
Florian Bruhin
aa3970c83e Merge branch 'pr/3371' 2018-02-07 18:26:19 +01:00
Florian Bruhin
1c662ae94c Revive iframe test as flaky
See #1525
2018-02-07 18:25:25 +01:00
Florian Bruhin
0bdee1e292 Stabilize the flaky iframe test
The test above this one loads hello.txt, but we don't wait for the "load
finished" message, so it can arrive after the previous test already finished and
make this test not wait properly.

However, we also can't easily wait for the load finished message in the
previous test as it only appears with QtWebEngine, not QtWebKit.

As a workaround, we simply load another file in that test, to circumvent this
kind of cross-interaction.
2018-02-07 18:16:03 +01:00
Florian Bruhin
e874db9ce3 Remove pytest version filter 2018-02-07 12:05:29 +01:00
Florian Bruhin
5135e0f35d Add .pytest_cache to .gitignore 2018-02-07 12:04:42 +01:00
Florian Bruhin
6d1e3fb2b7 Add missing more-itertools requirements 2018-02-07 12:04:09 +01:00
Florian Bruhin
e6a4237e1b Revert "Downgrade PyQt again"
This reverts commit c987a94596.
2018-02-07 11:53:47 +01:00
Florian Bruhin
e5771c785e Merge branch 'pyup-scheduled-update-2018-02-05' 2018-02-07 11:49:03 +01:00
Florian Bruhin
29e8c01d17 Merge branch 'qt510-2' 2018-02-07 11:48:39 +01:00
Florian Bruhin
054b92bbe8 Support retrying downloads with Qt 5.10
Fixes #2787
2018-02-07 11:19:41 +01:00
Florian Bruhin
7537acfd5d Use PyQt 5.10 on AppVeyor 2018-02-07 10:53:13 +01:00
Florian Bruhin
d9e095f7cf Add PyQt 5.10 to Travis CI
See #3522
2018-02-07 10:52:34 +01:00
Perry Thompson
ec7583eb97 Add troubleshooting info for widevine to FAQ 2018-02-06 17:52:05 -06:00
Florian Bruhin
5fd3943ebc Make callback mandatory for tab.selection() 2018-02-06 23:33:37 +01:00
Florian Bruhin
c987a94596 Downgrade PyQt again
Upgrading PyQt in a separate branch.
2018-02-06 23:18:53 +01:00
Florian Bruhin
20d5b4e384 Update pytest log handling
In pytest 3.4, we now need to explicitly set the log level and caplog.at_level
now sets the level of the root handler.
2018-02-06 23:17:40 +01:00
Florian Bruhin
ce8d15d2b0 Simplify selection handling and remove QUTE_SELECTED_HTML
It was broken at least since caret support was introduced and it was only
available for QtWebKit anyways, so let's just drop it. This also makes the tab
API a bit simpler.
2018-02-06 22:48:00 +01:00
Florian Bruhin
16375f20d5 Always use JavaScript to get selection
It looks like getting the selection via the widget has issues even with Qt 5.10.

On Windows, we always get wrong results.

On Linux, it seems to be flaky. I first thought this was because of a race
between JavaScript setting the selection and Qt getting it, as now we don't use
JS to get the selection anymore, so it's possible that we get it before the
older JS code finished running. However, even calling selectedText() from a JS
callback didn't seem to help...

Since has_selection also is flawed and it taking a callback would make code more
complex as well, let's just assume there is a selection if the text is not
empty. In fact, that is exactly what QtWebEngine does for hasSelection anyways!

Fixes #3523
2018-02-06 21:58:31 +01:00
George Edward Bulmer
5ceecc2b04 Add docstring for new argument 2018-02-06 18:53:45 +00:00
George Edward Bulmer
9c47128799 Use provided methods instead of protected members 2018-02-06 18:25:15 +00:00
George Edward Bulmer
0893e3a038 Fix boolean variable name 2018-02-06 17:35:24 +00:00
George Edward Bulmer
26810e02c1 Add a way to view source in editor 2018-02-06 17:22:59 +00:00
Florian Bruhin
8c39e8f764 Update changelog
[ci skip]
2018-02-06 14:13:06 +01:00
George Edward Bulmer
22c33ddfb8 Add special cases of double quotes: eg {{url}}
This allows a second level of indirection quite cheaply, but is a
band-aid fix.

This commit should be taken as temporary until command arguments are
reworked.
2018-02-05 21:45:49 +00:00
George Edward Bulmer
8b29ce93ec Add substitutions for the other 3 types 2018-02-05 21:40:12 +00:00
George Edward Bulmer
bfeac178e2 Make {suburl} expand to {url}
This is useful for the following case from IRC:
`:set aliases '{"twmpv": "spawn mpv {suburl}"}'

which now sets:
:twmpv -> spawn mpv {url}
2018-02-05 21:00:29 +00:00
pyup-bot
9eefbf24a2 Update pytest-bdd from 2.19.0 to 2.20.0 2018-02-05 16:59:33 +01:00
pyup-bot
782ec573ab Update pytest from 3.3.1 to 3.4.0 2018-02-05 16:59:32 +01:00
pyup-bot
8ee3c743e4 Update hypothesis from 3.44.21 to 3.44.25 2018-02-05 16:59:30 +01:00
pyup-bot
fac666e607 Update sip from 4.19.6 to 4.19.7 2018-02-05 16:59:29 +01:00
pyup-bot
67623930dd Update pyqt5 from 5.9.2 to 5.10 2018-02-05 16:59:27 +01:00
pyup-bot
4a9cbf8930 Update pylint from 1.8.1 to 1.8.2 2018-02-05 16:59:26 +01:00
pyup-bot
08ea34174c Update astroid from 1.6.0 to 1.6.1 2018-02-05 16:59:24 +01:00
pyup-bot
8579616fea Update isort from 4.2.15 to 4.3.2 2018-02-05 16:59:23 +01:00
pyup-bot
417a114a94 Update isort from 4.2.15 to 4.3.2 2018-02-05 16:59:21 +01:00
pyup-bot
d3050d73ba Update setuptools from 38.4.0 to 38.5.0 2018-02-05 16:59:19 +01:00
pyup-bot
46b85c11f1 Update flake8-bugbear from 17.12.0 to 18.2.0 2018-02-05 16:59:18 +01:00
pyup-bot
cfcd1bba1e Update coverage from 4.4.2 to 4.5 2018-02-05 16:59:16 +01:00
pyup-bot
075dd8e0a4 Update coverage from 4.4.2 to 4.5 2018-02-05 16:59:15 +01:00
pyup-bot
8fc88a68fb Update codecov from 2.0.14 to 2.0.15 2018-02-05 16:59:13 +01:00
Florian Bruhin
6f028e9ad0 Update copyright years 2018-02-05 12:19:50 +01:00
seebye
8dbf506916 Fix #3542 going back twice on lazy loading a tab 2018-02-05 01:20:56 +01:00
Florian Bruhin
c8de4675db Various spelling fixes 2018-02-04 21:30:59 +01:00
Jay Kamat
0ebde6f2e9 Delete QWebEngineDownloadItem objects when wrapper object is deleted 2018-02-04 13:41:23 -05:00
Ryan Roden-Corrent
a8733d7228 Increase timeout in test_editor.
The test with watch=True was failing on the Travis OSX environment
becausee it was timing out before the file_updated signal was fired.
2018-02-04 07:02:25 -05:00
Ryan Roden-Corrent
833df95485 Only detect save for open-editor and config-edit.
Scope down the new trigger-on-save behavior to only open-editor and
config-edit. Other uses of the editor such as edit-url and edit-command
will behave as before.
2018-02-03 19:57:47 -05:00
Marc Jauvin
989e60b01f Revert "fix line length"
This reverts commit def2920a35.
2018-02-03 19:10:19 -05:00
Jay Kamat
d7a436568c Add a new --no-last flag to :tab-focus
--no-last prevents going to the last focused tab if a new tab does not
need to be focused.
2018-02-03 14:31:44 -05:00
Ryan Roden-Corrent
ceab4a4c1f Fix pylint warnings 2018-02-03 08:12:45 -05:00
Ryan Roden-Corrent
0aefffce4d Attempt to solve flaky editor tests.
These are passing locally but failing in travis. This fixes two possible
timing issues:

- Ensure the signals are set up befor the pidfile is written. The
  function that sends the signal waits for the pidfile to exist, so this
  ensures we don't miss a signal.
- Wait for the log message indicating that the editor file was read
  back, so the test doesn't run through before we get a chance to read
  from the editor.
2018-02-01 20:55:18 -05:00
Ryan Roden-Corrent
eab9b70f28 Fix pylint for editor.py.
Notate unused parameter.
2018-02-01 20:43:35 -05:00
Marc Jauvin
a70feae98f Merge branch 'master' of https://github.com/qutebrowser/qutebrowser into issue#3547-spawn-race-condition 2018-01-31 18:13:48 -05:00
Marc Jauvin
132095c98c only open the tab for output once the job has finished running 2018-01-31 18:05:23 -05:00
Marc Jauvin
def2920a35 fix line length 2018-01-31 18:05:14 -05:00
Florian Bruhin
79935e048c Break long line 2018-01-31 22:35:03 +01:00
Florian Bruhin
5e96dc4374 Merge pull request #3543 from Knowlege/master
Updated PyYaml link
2018-01-30 23:33:28 +01:00
Knowlege
532205aafa Updated PyYaml link 2018-01-30 23:29:02 +01:00
lufte
d8510e61aa Use the instance attribute instead of querying the registry 2018-01-30 19:26:45 -03:00
Florian Bruhin
fb5d0f7e14 Merge pull request #3540 from mjauvin/system-proxy
document proxy environment variable for system proxy
2018-01-30 15:56:53 +01:00
Marc Jauvin
b55ae02eda document proxy environment variable for system proxy 2018-01-30 09:48:52 -05:00
Florian Bruhin
400e1bc7d7 Show tab titles as tooltip
Closes #3535
2018-01-30 07:11:48 +01:00
Ryan Roden-Corrent
e9023ce233 Remove newline in editor.py 2018-01-29 07:50:32 -05:00
Marc Jauvin
f16f425cb1 generate the docs 2018-01-28 10:41:09 -05:00
Marc Jauvin
1a2ab0ffe7 add back rl-yank key binding; use alt-y for prompt-yank. 2018-01-28 10:28:11 -05:00
Florian Bruhin
d01a0b1d64 Fix :bookmark-add with no URL 2018-01-28 13:05:49 +01:00
Ryan Roden-Corrent
530a1859a3 Trigger editor signal on exit if content changed.
With the previous code, the editor could miss the final signal on a
save-and-exit. This is avoided by always running the file changed
handler on a successful exit, but only firing the signal if the content
actually changed (to avoid double-signalling).
2018-01-27 15:03:18 -05:00
Ryan Roden-Corrent
7c33ff4046 Fix flaky editor test.
Give the process time to write its PID before trying to interrupt it.
2018-01-27 15:03:18 -05:00
Ryan Roden-Corrent
2e5595b5c6 Update test_configcommands for new editor behavior.
Now that the editor signals on save, the configcommands editing
unittests need to emit the signal in the patch rather than relying on
on_proc_closed to emit the signal.
2018-01-27 15:03:18 -05:00
Ryan Roden-Corrent
a940de3717 Rename editing_finished to file_updated.
ExternalEditor now fires an event on save rather than on exit, so the
signal name should be updated to match the behavior.
2018-01-27 15:03:18 -05:00
Ryan Roden-Corrent
23eb6a6c53 Fix test_editor for edit-on-write behavior.
Now that the editor fires editing_finished on every write, the unit
tests had to be updated.

- Add qtbot to the editor fixture to resolve `QtWarningMsg:
  QSocketNotifier: Can only be used with threads started with QThread`
- Use removePaths instead of disconnect to stop the watcher from
  signalling. This avoids an error when the editor is forcibly cleaned
  up by the tests without the signal ever being connected, but otherwise
  has the same behavior as disconnecting the singal.
- wait for a signal on write instead of proc closed
- wait for _watcher.fileChanged in test_unreadable to ensure the write
  event is fired before the test exits.
2018-01-27 15:03:18 -05:00
Ryan Roden-Corrent
8a9b98c2dc Editor triggers update on every save.
For any command that spawns an editor, tirgger an update on save, not
just on exit.

- :open-editor writes the text field on save
- :edit-url navigates on save
- :edit-url -t opens a new tab on each save
- :edit-command updates the statusbar text on save
- :edit-command --run runs a command on each save
- :config-edit reloads the config on save

Resolves #2307.
Helps mitigate #1596 by allowing users to 'save' partial work, and
notice if there was an error without closing the editor.
2018-01-27 15:03:18 -05:00
Marc Jauvin
fe4dd579f9 add --sel option to prompt-yank 2018-01-26 22:06:05 -05:00
Florian Bruhin
cdaf3ac097 Fix .Xresources example
[ci skip]
2018-01-26 18:32:27 +01:00
Florian Bruhin
1dac05a7ac Fix test_tab.py 2018-01-26 11:58:02 +01:00
Florian Bruhin
24cc54a574 Simplify initializing of AbstractTab subclasses
If we already pass the tab object, no need to pass the window ID separately.
2018-01-26 09:47:26 +01:00
Florian Bruhin
4b9bba7505 Edit changelog 2018-01-26 09:38:49 +01:00
Florian Bruhin
677e188894 Update docs 2018-01-26 09:37:35 +01:00
Florian Bruhin
125b3c1de9 Merge remote-tracking branch 'origin/pr/3521' 2018-01-26 09:25:50 +01:00
Marc Jauvin
d2287b7a2e move backend specific code out of AbstractTab into respective backend
classes.
2018-01-25 22:38:25 -05:00
Marc Jauvin
ddcc960aa5 url arg was a string 2018-01-25 22:01:18 -05:00
Marc Jauvin
88ff0c0425 url_str -> urlstr: urlstr used accross the codebase, more consistent 2018-01-25 18:01:43 -05:00
Marc Jauvin
520b473350 modify Question.yank_text to Question.url
error out when question.url is None
add url to yesno prompts
add default binding in prompt mode (ctrl-y)
2018-01-25 17:48:45 -05:00
Marc Jauvin
bb8bc7ea3c fix test related to view-source
remove pygment title
remove view-source from history
2018-01-25 15:17:03 -05:00
Marc Jauvin
eb888cc8d7 fix latest change requests 2018-01-25 13:35:23 -05:00
Florian Bruhin
b93bee18d0 Regenerate docs 2018-01-25 11:03:45 +01:00
Florian Bruhin
40df5baa83 Merge remote-tracking branch 'origin/pr/3515' 2018-01-25 09:04:44 +01:00
Florian Bruhin
ab4c875792 Update changelog 2018-01-25 09:03:47 +01:00
Florian Bruhin
54e9edfd60 Merge remote-tracking branch 'origin/pr/3515' 2018-01-25 09:02:20 +01:00
Marc Jauvin
3b1fb92b11 remove extra line to satisfy flake8 2018-01-24 19:13:28 -05:00
Marc Jauvin
d77c9ae009 Add prompt-yank command
add yank_text property to utils.usertypes.Question class

Resolves #2591
2018-01-24 18:53:06 -05:00
Marc Jauvin
d7c51f7fc4 implement requested changes for PR #3521. 2018-01-24 18:04:05 -05:00
Daniel Hahler
4f04c776c1 fixup! fixup! incdec_number: add support for port 2018-01-24 22:22:00 +01:00
Florian Bruhin
56f83ddde4 Update changelog 2018-01-24 21:33:32 +01:00
Florian Bruhin
961eebaf71 Merge remote-tracking branch 'origin/pr/3510' 2018-01-24 21:33:04 +01:00
Florian Bruhin
3df469bc38 Update changelog 2018-01-24 21:30:17 +01:00
Florian Bruhin
582236e42b Merge remote-tracking branch 'origin/pr/3509' 2018-01-24 21:28:58 +01:00
Florian Bruhin
c153ff5a97 Update docs 2018-01-24 21:15:10 +01:00
Florian Bruhin
e5b6ccd716 Merge remote-tracking branch 'origin/pr/3506' 2018-01-24 21:14:25 +01:00
Florian Bruhin
7690b9f8cd Update changelog 2018-01-24 20:56:29 +01:00
Florian Bruhin
caca3614f8 Merge remote-tracking branch 'origin/pr/3443' 2018-01-24 20:36:15 +01:00
Florian Bruhin
b1c54f5706 Re-add Qt 5.10 to tox.ini only 2018-01-24 06:17:09 +01:00
Marc Jauvin
2e912eeadf move backend dependent code to AbstractAction respective classes 2018-01-23 23:30:22 -05:00
Florian Bruhin
072d42347a Revert "Also use PyQt 5.10 on AppVeyor"
This reverts commit c3deeaf283.
2018-01-23 20:36:40 +01:00
Florian Bruhin
e26e04985b Revert "Update to PyQt 5.10"
This reverts commit a701426703.
2018-01-23 20:36:31 +01:00
Florian Bruhin
c3deeaf283 Also use PyQt 5.10 on AppVeyor 2018-01-23 20:00:14 +01:00
Florian Bruhin
a701426703 Update to PyQt 5.10 2018-01-23 19:42:22 +01:00
Florian Bruhin
3652553a8f Mark second qute://settings test as flaky 2018-01-23 19:42:22 +01:00
Marc Jauvin
83515628a8 fix line indentation warning 2018-01-23 10:11:34 -05:00
Marc Jauvin
56e6864159 Inject qutebrowser's JS files at DocumentReady
Use WebEngine's view-source: scheme for "view-source" command.
Also add missing URL when viewing source for WebKit.

Resolves #3490
Resolves #2395
Resolves #2948
2018-01-23 10:03:04 -05:00
Florian Bruhin
b0cc0c62cc Merge pull request #3513 from qutebrowser/pyup-scheduled-update-01-22-2018
Scheduled weekly dependency update for week 03
2018-01-23 07:35:37 +01:00
Florian Bruhin
0d12ddc3ea Merge pull request #3514 from blueyed/vim-readonly
scripts/dev/src2asciidoc.py: vim: readonly
2018-01-23 07:35:14 +01:00
Daniel Hahler
9f14ae184f fixup! incdec_number: add support for port 2018-01-22 21:48:21 +01:00
Daniel Hahler
6a40cbf160 incdec_number: add support for port 2018-01-22 21:26:46 +01:00
Daniel Hahler
dd0703eddf scripts/dev/src2asciidoc.py: vim: readonly
Set 'readonly' via Vim modeline in generated scripts.
2018-01-22 21:21:54 +01:00
pyup-bot
c5c01c5364 Update hypothesis from 3.44.16 to 3.44.21 2018-01-22 16:52:20 +01:00
pyup-bot
abd5da1fd1 Update codecov from 2.0.13 to 2.0.14 2018-01-22 16:52:18 +01:00
pyup-bot
036031a48b Update certifi from 2017.11.5 to 2018.1.18 2018-01-22 16:52:17 +01:00
pyup-bot
762205ef07 Update certifi from 2017.11.5 to 2018.1.18 2018-01-22 16:52:15 +01:00
pyup-bot
6edd096de4 Update certifi from 2017.11.5 to 2018.1.18 2018-01-22 16:52:14 +01:00
Simon Doppler
02396cb455 Remove useless function 2018-01-22 16:12:45 +01:00
Simon Doppler
f11d7ab489 Check if the window still exists 2018-01-22 16:11:59 +01:00
Simon Doppler
ab9f17b053 Use default value for dictionary item in tabs handler 2018-01-22 16:08:30 +01:00
Ryan Roden-Corrent
1e9a70855d Show '&' properly in completion widget.
When highlighting the matched part of the text, we need to html-escape
the pattern used to find the matching text so it will replace terms that
have been escaped in the text, like &amp;.

Resolves #3508.
2018-01-21 07:46:53 -05:00
Ryan Roden-Corrent
9d5beff937 Set some PRAGMAs to optimize the history database.
Enable write-ahead-logging and reduce the synchronous level to NORMAL.
This should reduce the number of writes to disk and avoid some of the
hangs users are experiencing.

Resolves #3507.
Resolves #2930 (optimistically, reopen if not fixed).

See https://sqlite.org/pragma.html and https://www.sqlite.org/wal.html.
2018-01-20 15:49:52 -05:00
Florian Bruhin
d62cb58f7d Release v1.1.1
(cherry picked from commit 4e8abaa2d1)
2018-01-20 19:21:40 +01:00
Florian Bruhin
9c3dcae793 Update changelog for v1.1.1 2018-01-20 19:20:12 +01:00
Florian Bruhin
84478cd81c Update changelog 2018-01-20 18:58:03 +01:00
Florian Bruhin
748de85ba2 Fix crash when getting signals for closed tabs
Fixes #3498
2018-01-20 18:50:17 +01:00
Florian Bruhin
4b3a237e2a Update changelog 2018-01-20 18:29:23 +01:00
Florian Bruhin
1f5cbf21a3 Merge remote-tracking branch 'origin/pr/3348' 2018-01-20 18:28:14 +01:00
Florian Bruhin
182bf1d688 Simplify platform handling 2018-01-20 16:43:39 +01:00
Jimmy
aebc1a7d48 Greasemonkey: don't complain about an unset run-at
Apparently is is not an unusual situation to leave it unset and rely on
the default. Logging a warning about this could be unnecerasily
confusing for users.

I'm leaving the log message in there if it is set to something weird
like `window-load` or `document-complete` which scriptish may support.
2018-01-20 13:40:53 +13:00
Jimmy
d5d22783ea Greasemonkey: optimize pattern matching a little
Moving `QUrl.toString()` out of the `_match()` function which is called
for every pattern in every stript seems to make it ~40% faster.
2018-01-20 13:40:53 +13:00
Jimmy
971b413991 Greasemonkey: make *clude regexes case insensitive
Sometimes I don't read specs so good.
2018-01-20 13:40:47 +13:00
Jimmy
b2f95339ce Greasemonkey: support regexes in @include and @exclude.
Like the spec says, if a value for the @include or @exclude rules starts
and ends with a '/' it should be parsed as a regular expression.
Technically a ECMAScript syntax regular expression, but I am not sure of
the differences and I assume they are far fewer than the similarities.
One that I did see mentioned was that javascript RegExp doesn't support
unicode. Although it apparently does support a 'u' flag now.

Note that code will only be ran for QtWebkit and QWebEngine < 5.8
we rely on the builtin support for metadata it QWebEngine for most
things greasemonkey related. Sadly it seems that they missed the regex
requirement too. I've opened a ticket to track that https://bugreports.qt.io/browse/QTBUG-65484
2018-01-20 13:39:19 +13:00
Jay Kamat
968367b042 Simplify logic for checking if an element is a frame 2018-01-19 15:25:03 -05:00
Artur Shaikhullin
1e3f11ca13 Fix eslint warnings 2018-01-19 23:17:03 +06:00
Artur Shaikhullin
22d77fadd7 Eliminate caret blinking 2018-01-19 22:40:47 +06:00
Artur Shaikhullin
2d2d71512f Add initial comment 2018-01-19 22:31:12 +06:00
Artur Shaikhullin
79766aa65b Add chromium license 2018-01-19 22:28:49 +06:00
Artur Shaikhullin
0e522d48ac Add myself to CODEOWNERS to watch for caret code 2018-01-19 22:25:58 +06:00
Artur Shaikhullin
6eb001fc34 Rename js caret file 2018-01-19 22:24:11 +06:00
Artur Shaikhullin
859469c600 Remove redundancy comment 2018-01-19 22:15:54 +06:00
Artur Shaikhullin
4fde8ff204 Add separate function in js to set current platform 2018-01-19 22:14:01 +06:00
Marc Jauvin
4a4a6549d0 use a temporary attribute of the class to prevent the loop; tested to work in both backends 2018-01-19 09:34:45 -05:00
Marc Jauvin
9e258a490e might as well use the same loop prevention mechanism for both backends 2018-01-19 06:59:40 -05:00
Argn0
bd7054fa2e use self.delete and add test 2018-01-19 09:29:37 +01:00
Argn0
aeb7bac886 added :session-load --delete 2018-01-19 02:33:42 +01:00
Marc Jauvin
a2ca59b822 add netrc support for webengine. resolves #2785. 2018-01-18 18:06:47 -05:00
Florian Bruhin
cb2cd615e0 Update docs 2018-01-18 07:57:31 +01:00
Florian Bruhin
380021e818 Merge remote-tracking branch 'origin/pr/3484' 2018-01-18 07:54:42 +01:00
Jay Kamat
12d729c3bc Merge remote-tracking branch 'upstream/master' into jay/frame-hinting 2018-01-17 17:24:43 -05:00
Jay Kamat
ffda82170d Fix several style issues 2018-01-17 17:02:53 -05:00
Slackhead
ef1de133ed remove old cycle-inputs.js 2018-01-17 19:41:54 +00:00
Slackhead
743aa86dfb run eslint on cycle-inputs.js 2018-01-17 19:32:05 +00:00
Marc Jauvin
72c97ca846 sort modes, "normal" mode first 2018-01-17 14:25:07 -05:00
Jay Kamat
c5e688f26c Stop iterating over every frame to check if element is frame 2018-01-17 13:08:04 -05:00
Marc Jauvin
5db4493667 @The-Compiler requested changes addressed. 2018-01-17 10:11:32 -05:00
Florian Bruhin
c86eaa17e2 Update changelog 2018-01-17 15:54:32 +01:00
Florian Bruhin
b3ebcfd394 Merge remote-tracking branch 'origin/pr/3482' 2018-01-17 15:53:47 +01:00
Florian Bruhin
23bdee06b3 Update changelog 2018-01-17 14:42:13 +01:00
Florian Bruhin
923785c781 Merge remote-tracking branch 'origin/pr/3467' 2018-01-17 14:41:45 +01:00
Florian Bruhin
06075a4974 Update docs 2018-01-17 13:38:54 +01:00
Florian Bruhin
a1798b3843 Merge remote-tracking branch 'origin/pr/3474' 2018-01-17 13:38:22 +01:00
Florian Bruhin
54a93dfcf8 Update changelog 2018-01-17 13:27:32 +01:00
Florian Bruhin
4acb63ca49 Merge remote-tracking branch 'origin/pr/3478' 2018-01-17 13:23:31 +01:00
Florian Bruhin
d5f7ec4372 Update changelog 2018-01-17 11:43:31 +01:00
Florian Bruhin
d94c0cf064 Merge remote-tracking branch 'origin/pr/3464' 2018-01-17 11:42:24 +01:00
Marc Jauvin
e25a33790f remove blank line to satisfy flake8 2018-01-15 20:44:56 -05:00
Florian Bruhin
d06f07af80 Fix Makefile and make sure it's tested
Fixes #3492
2018-01-15 22:42:12 +01:00
Marc Jauvin
9bb256b545 shorten lines 2018-01-15 16:19:38 -05:00
Marc Jauvin
fb0a418d0a use url even if we do not need it 2018-01-15 16:03:22 -05:00
Marc Jauvin
2a274f0d8b add test for bind without args and fix other tests to include win_id 2018-01-15 15:52:15 -05:00
Marc Jauvin
528b48dab6 fix line too 2018-01-15 15:51:14 -05:00
Marc Jauvin
9b473093b1 silence pylint warning 2018-01-15 15:45:29 -05:00
Marc Jauvin
f6cfb0c529 add missing super() call 2018-01-15 15:44:21 -05:00
Marc Jauvin
7d620a4bfc fix pylint/flake8 errors 2018-01-15 13:39:42 -05:00
Florian Bruhin
fbbb9ae940 Release v1.1.0 2018-01-15 19:39:16 +01:00
Florian Bruhin
d3f3be03dd Update changelog for v1.1.0 2018-01-15 19:29:14 +01:00
Florian Bruhin
8fd6a2ff77 Merge pull request #3445 from seelaman/hist_import-cleaning
filter out records with None in any field.
2018-01-15 19:15:08 +01:00
Florian Bruhin
af163eca09 Merge pull request #3491 from qutebrowser/pyup-scheduled-update-01-15-2018
Scheduled weekly dependency update for week 02
2018-01-15 19:06:06 +01:00
pyup-bot
f2beaa455e Update hypothesis from 3.44.13 to 3.44.16 2018-01-15 16:44:12 +01:00
Marc Jauvin
05d076ba9f fix asciidoc for tabs.mode_on_change 2018-01-15 09:09:13 -05:00
Florian Bruhin
8c8cb3bc29 Fix crash when clicking <form> element with name="value" child
https://stackoverflow.com/q/22942689/2085149

Fixes #2877
See #2569
2018-01-14 20:20:51 +01:00
Marc Jauvin
81b85994a1 document code a bit more 2018-01-14 13:29:51 -05:00
Nemanja Nedeljkovic
8d8566a5ab Merge branch 'master' of github.com:qutebrowser/qutebrowser into angular-hints 2018-01-13 23:18:39 +01:00
Marc Jauvin
a2cdb2e4db Merge branch 'patch-issue#24' of https://github.com/mjauvin/qutebrowser into patch-issue#24 2018-01-13 15:55:05 -05:00
Marc Jauvin
48b6c160f5 improve styling as suggested by @jgkamat 2018-01-13 15:52:49 -05:00
Christian Helbling
cd20c32973 simplify more 2018-01-13 10:48:13 +01:00
Christian Helbling
141d020ede import debug is not needed anymore 2018-01-13 10:47:58 +01:00
Marc Jauvin
4848182204 code cleanup
- move qute_bindings block AFTER qute_settings block
- remove unnecessary variable declaration
2018-01-13 01:39:05 -05:00
Marc Jauvin
1e8694f3cc remove unused module 2018-01-12 17:35:04 -05:00
Marc Jauvin
3a7ac51a00 html template to render qute://bindings 2018-01-12 17:28:56 -05:00
Marc Jauvin
8940e05baf bind without agruments shows current bindings 2018-01-12 17:27:44 -05:00
Marc Jauvin
4ae33deebd add handler for qute://bindings 2018-01-12 17:24:20 -05:00
Marc Jauvin
5dbfff016e replace persist_mode_on_change with mode_on_change
supports old persist_mode_on_change functionality or new save/restore mode
2018-01-12 17:05:47 -05:00
Marc Jauvin
c87d8d0d8f add propery to save tab input mode 2018-01-12 17:02:34 -05:00
Marc Jauvin
f7a08dfd34 use tabs.mode_on_change to persist or restore mode 2018-01-12 16:57:05 -05:00
Christian Helbling
559059d244 simplify code - state_before_fullscreen seems not to be needed anymore 2018-01-12 11:21:55 +01:00
Christian Helbling
699abef159 fix regression of #2778 which reappeared with qt 5.10 in combination with up-to-date KDE
this should also avoid an unneccessary KDE maximize animation when exiting fullscreen into maximized
2018-01-12 10:54:05 +01:00
Argn0
d9741d56c5 removed a trailing whitespace 2018-01-11 16:38:55 +01:00
Argn0
57e8b428c3 e.accept() and return 2018-01-11 15:45:44 +01:00
Argn0
200b36bd36 review 1 2018-01-11 14:09:08 +01:00
Argn0
2d7dd391a3 review 1 2018-01-11 14:08:17 +01:00
Argn0
e654abf128 deleted folder 2018-01-11 14:05:18 +01:00
Argn0
66d0591684 new method 2018-01-11 14:03:43 +01:00
Argn0
4932323d3b review 1 setText 2018-01-11 12:40:20 +01:00
Argn0
860b22c0e0 review 1 2018-01-10 22:05:14 +01:00
Argn0
9fd2ad9909 review 1 2018-01-10 21:34:19 +01:00
Argn0
1db4309eec review 1 2018-01-10 21:29:31 +01:00
Argn0
2c4d2beea3 option to close commandline by deleting the prefix 2018-01-10 20:14:09 +01:00
Argn0
be5b8e2632 option to close commandline by deleting the prefix 2018-01-10 20:02:39 +01:00
Argn0
5003432a55 option to close commandline by deleting the prefix 2018-01-10 19:59:34 +01:00
Florian Bruhin
1f8d6e2168 Update changelog 2018-01-10 09:39:46 +01:00
Florian Bruhin
6b9edefb05 Merge remote-tracking branch 'origin/pr/3432' 2018-01-10 09:39:08 +01:00
Florian Bruhin
0518a03b1e Merge remote-tracking branch 'origin/pr/3423' 2018-01-10 09:38:07 +01:00
Florian Bruhin
c1855e1741 Update changelog 2018-01-10 09:35:42 +01:00
Florian Bruhin
b2ed0c0081 Merge remote-tracking branch 'origin/pr/3468' 2018-01-10 09:35:28 +01:00
Florian Bruhin
05b005ce5c Merge pull request #3475 from qutebrowser/pyup-scheduled-update-01-08-2018
Scheduled weekly dependency update for week 01
2018-01-09 13:01:31 +01:00
Simon Doppler
dea0aa9f7c Add tabs page 2018-01-08 18:01:42 +01:00
pyup-bot
7b348fe17c Update pytest-qt from 2.3.0 to 2.3.1 2018-01-08 16:39:21 +01:00
pyup-bot
70ad02b79b Update hypothesis from 3.44.4 to 3.44.13 2018-01-08 16:39:20 +01:00
pyup-bot
6a3b5a9d4e Update setuptools from 38.2.5 to 38.4.0 2018-01-08 16:39:18 +01:00
pyup-bot
8459c662e7 Update pep8-naming from 0.4.1 to 0.5.0 2018-01-08 16:39:17 +01:00
pyup-bot
f836b615c1 Update flake8-future-import from 0.4.3 to 0.4.4 2018-01-08 16:39:15 +01:00
pyup-bot
6c91633293 Update flake8-docstrings from 1.1.0 to 1.3.0 2018-01-08 16:39:14 +01:00
pyup-bot
0101596148 Update codecov from 2.0.10 to 2.0.13 2018-01-08 16:39:12 +01:00
Nemanja Nedeljkovic
5f3ee66775 Code style improvement and documentation 2018-01-07 12:06:36 +01:00
Nemanja Nedeljkovic
957d5b3f02 Add more angular1 selectors 2018-01-07 11:58:02 +01:00
Nemanja Nedeljkovic
ec08a19e7d Rename angular.html to angular1.html 2018-01-07 11:23:28 +01:00
Nemanja Nedeljkovic
64dac66259 local angular 2018-01-07 11:22:46 +01:00
Artur Shaikhullin
81a9ea58d6 Restore pylint rule 2018-01-07 09:25:29 +06:00
Fritz Reichwald
9b4da25578 Fix another test by using the new KeySequence 2018-01-07 00:11:47 +01:00
Nemanja Nedeljkovic
9bb6ba0823 Fix 2018-01-06 22:09:17 +01:00
Nemanja Nedeljkovic
22725beede Maybe fix? 2018-01-06 21:22:12 +01:00
Nemanja Nedeljkovic
f64af6b64a Angular 1 test 2018-01-06 20:45:13 +01:00
Jay Kamat
8500509532 Implement is_visible for same-origin frames 2018-01-06 11:13:54 -08:00
Fritz Reichwald
dc66ec5d8c Fix expectation in Fullscreen info message to fit new description of 2018-01-06 20:01:57 +01:00
Nemanja Nedeljković
555f43c854 Add ng-click for hinting to Angular 1.x links 2018-01-06 19:18:17 +01:00
Artur Shaikhullin
aebd59247d Check platform variable 2018-01-06 22:45:53 +06:00
Artur Shaikhullin
c4e50369e7 Enable caret only when mode is 'caret' 2018-01-06 22:43:39 +06:00
Florian Bruhin
089a3990ff Merge pull request #3454 from qutebrowser/pyup-scheduled-update-01-01-2018
Scheduled weekly dependency update for week 00
2018-01-06 09:57:44 +01:00
Artur Shaikhullin
dc8c919c30 Fix pylint warnings 2018-01-05 22:44:07 +06:00
Artur Shaikhullin
5553e64a75 Restore chrome-caretbrowsing extension comments 2018-01-05 19:21:55 +06:00
Artur Shaikhullin
8268c1d7ff Disable eslint rules globally 2018-01-05 19:02:19 +06:00
Artur Shaikhullin
b6662fd243 Use inner functions for callbacks 2018-01-05 18:35:15 +06:00
Florian Bruhin
a90730bea7 Pin pytest to 3.3.1 for now
See https://github.com/pytest-dev/pytest-bdd/issues/229
2018-01-05 11:36:26 +01:00
Jay Kamat
3d508be9ff Clear unpinned tabs before prompting user with :tab-only 2018-01-04 18:34:40 -08:00
Andrea Scarpino
16fb9bc80e scripts: filter history records
We don't need to import history records about `moz-extensions`, `about` pages, `dactyl` and so on...
2018-01-04 19:46:18 +01:00
Ryan Roden-Corrent
c290b3f80f Don't attempt completion if input starts with flag.
Always interpret the first word in the command string as the command to
offer completions for, even if that word looks like a flag.

Fixes #3460, where the command string `:-w open` would attempt to offer
completions for `open` but crash because the parsing was thrown off.
By moving the flag-stripping logic to _after_ we determine the command,
`:-w open` interprets `:-w` as the command. Since that is not a valid
command, we won't offer any completions.
2018-01-04 12:34:06 -05:00
Florian Bruhin
c3bcb1d9ba Remove old testbrowser.py 2018-01-03 10:15:00 +01:00
Manuel Seelaus
9363bc3f24 replace empty titles with an empty string. https://github.com/qutebrowser/qutebrowser/pull/3445#issuecomment-354840724 2018-01-02 20:06:29 -07:00
pyup-bot
673919451e Update werkzeug from 0.13 to 0.14.1 2018-01-01 16:34:16 +01:00
pyup-bot
a98cd16ff3 Update flake8-polyfill from 1.0.1 to 1.0.2 2018-01-01 16:34:15 +01:00
pyup-bot
8cec185e4b Update attrs from 17.3.0 to 17.4.0 2018-01-01 16:34:13 +01:00
pyup-bot
9c256740c6 Update attrs from 17.3.0 to 17.4.0 2018-01-01 16:34:12 +01:00
pyup-bot
26bbd10952 Update attrs from 17.3.0 to 17.4.0 2018-01-01 16:34:10 +01:00
Slackhead
7aecebf028 Add cycle-inputs.js to scripts 2017-12-31 15:08:36 +00:00
Slackhead
e989d948ed Add cycle-inputs.js to userscripts 2017-12-31 14:47:42 +00:00
Artur Shaikhullin
695f734142 Extract js call method 2017-12-30 23:46:04 +06:00
Artur Shaikhullin
e22dc1b5c6 Update copyright year 2017-12-30 23:37:57 +06:00
Artur Shaikhullin
fe4eb19ecf Add link to chrome-caretbrowsing extension 2017-12-30 23:37:17 +06:00
Artur Shaikhullin
6dc3108747 Get OS name using python 2017-12-30 23:35:12 +06:00
Florian Bruhin
f5edd4941e Fix MANIFEST.in for testbrowser 2017-12-30 18:33:15 +01:00
Artur Shaikhullin
981f5fd09b Remove unused import 2017-12-30 23:20:29 +06:00
Artur Shaikhullin
25436e2544 Fix eslint warnings 2017-12-30 09:43:16 +06:00
Florian Bruhin
28889cf099 Use a dict for ModeManager.eventFilter 2017-12-29 20:36:55 +01:00
Florian Bruhin
e7af961be2 Remove filtering of mouse events
This was needed for the hide-mouse-cursor setting. However, this setting was
removed in 2223a285ef, so this code has been dead
since then.
2017-12-29 19:36:52 +01:00
Florian Bruhin
a6adbdf167 Clean up testbrowser scripts 2017-12-29 19:10:33 +01:00
Artur Shaikhullin
e254ea2fa7 Add license and description 2017-12-29 23:43:39 +06:00
Florian Bruhin
dcf89f7a28 Fix KeyConfig._prepare 2017-12-29 16:10:12 +01:00
Florian Bruhin
a145497c65 Make :unbind work correctly 2017-12-29 16:05:16 +01:00
Florian Bruhin
81e9060239 Make sure KeySequence keys are valid 2017-12-29 16:04:25 +01:00
Florian Bruhin
caa05df16d Use KeySequences in config.py 2017-12-29 15:58:20 +01:00
Florian Bruhin
7b3cb14e6e Revert "Try to have strings in KeyConfig"
This reverts commit 28b6b97f39.
2017-12-29 15:41:28 +01:00
Florian Bruhin
28b6b97f39 Try to have strings in KeyConfig 2017-12-29 15:41:12 +01:00
Artur Shaikhullin
d04a087c2b Try fix Windows caret issues 2 2017-12-29 20:10:18 +06:00
Florian Bruhin
737ff2cc69 Add <> around special keys in __str__ 2017-12-29 14:43:04 +01:00
Florian Bruhin
f1fe26b0b7 Handle modifiers correctly 2017-12-29 14:40:00 +01:00
Florian Bruhin
7b17ab4b3f Initial str() attempt 2017-12-29 14:22:20 +01:00
Artur Shaikhullin
882beab3f2 Try to fix Windows caret ussues 2017-12-29 19:01:12 +06:00
Florian Bruhin
d9c768ed86 Strip out shift modifier for non-alpha bindings 2017-12-29 13:53:43 +01:00
Artur Shaikhullin
db16a87e68 Removed unused import 2017-12-29 18:39:29 +06:00
Florian Bruhin
917f2a30de Get tests to collect 2017-12-29 13:23:38 +01:00
Artur Shaikhullin
3b836d3483 Fix lint warnings 2017-12-29 17:56:16 +06:00
Florian Bruhin
cc747b00ce Move parsing to class 2017-12-29 01:50:51 +01:00
Florian Bruhin
705767bcfb fixme 2017-12-29 01:43:47 +01:00
Florian Bruhin
5cee39d315 Initial move of keyutils tests 2017-12-29 01:41:55 +01:00
Florian Bruhin
c98eb5502d Add some FIXMEs 2017-12-29 01:24:05 +01:00
Florian Bruhin
d961211188 Delete some old code 2017-12-29 01:24:05 +01:00
Florian Bruhin
21b3e05ed0 Fix getting reverse bindings 2017-12-29 01:24:05 +01:00
Florian Bruhin
b1dde41b74 Rename sequence.py to keyutils.py 2017-12-29 01:24:05 +01:00
Florian Bruhin
dcf0d21121 Move key related utils to sequence.py 2017-12-29 01:24:05 +01:00
Florian Bruhin
600919a23a Add a custom KeySequence class 2017-12-29 01:24:05 +01:00
Florian Bruhin
a565b77bf0 Switch from string to QKeySequence 2017-12-29 01:24:05 +01:00
Florian Bruhin
8478a1ea3d Remove _handle_special_key 2017-12-29 01:24:05 +01:00
Florian Bruhin
26fdc129d3 Split off counts 2017-12-29 01:24:05 +01:00
Florian Bruhin
55803afbd2 Fix matching 2017-12-29 01:24:05 +01:00
Florian Bruhin
a8aaf01ff0 Fix some more stuff (and break some :D) 2017-12-29 01:24:05 +01:00
Florian Bruhin
ddcb5445a2 Initial refactoring for new key parsing 2017-12-29 01:24:05 +01:00
Florian Bruhin
7fe0f9fb16 Update qutebrowser xpm 2017-12-29 01:23:45 +01:00
Artur Shaikhullin
7d181ee4b5 Check if document body exists 2017-12-28 23:04:04 +06:00
Artur Shaikhullin
83f8d84012 Finally enable webengine test 2017-12-28 22:27:47 +06:00
Artur Shaik
734684636f Merge branch 'master' into webengine_caret 2017-12-28 20:45:01 +06:00
Artur Shaik
5605d3cd8e Merge branch 'master' into webengine_caret 2017-12-28 20:43:31 +06:00
Artur Shaikhullin
63658d3a1e Catch userscript exception and show error message 2017-12-28 20:40:37 +06:00
Artur Shaikhullin
9728e90401 Enable test in webengine 2017-12-28 20:05:10 +06:00
Artur Shaikhullin
a01566ed15 Fix loosed variable 2017-12-28 19:17:25 +06:00
Manuel Seelaus
2a7423a515 filter out records with None in any field. 2017-12-27 18:00:02 -07:00
RyanJenkins
53575aaeed Default raise_windows() alert param to True to preserve existing
behavior
2017-12-27 12:40:55 -08:00
RyanJenkins
9cb25e0c76 Raise browser window after editor closes regardless of outcome of
inserting text and avoid calling QApplication.instance().alert() in this
scenario.
2017-12-26 20:19:39 -08:00
Florian Bruhin
2ef6e740d9 Merge pull request #3441 from strburst/doc-configuring-fix-typo
Fix minor doc typo in example code
2017-12-26 17:26:47 +01:00
Allen Zheng
b5a9612840 Fix minor doc typo in example code
There should be an extra parenthesis to close the call to the outer
print function.
2017-12-26 11:21:02 -05:00
Florian Bruhin
d2f0c5dcac Update changelog 2017-12-26 15:45:50 +01:00
Florian Bruhin
73b6dea1f4 Merge remote-tracking branch 'origin/pr/3427' 2017-12-26 15:45:00 +01:00
Florian Bruhin
aa68e97922 Merge pull request #3435 from qutebrowser/pyup-scheduled-update-12-25-2017
Scheduled weekly dependency update for week 52
2017-12-26 15:05:37 +01:00
pyup-bot
501cabc6a0 Update pytest-rerunfailures from 3.1 to 4.0 2017-12-25 16:26:14 +01:00
pyup-bot
0d61c75ce4 Update hypothesis from 3.44.1 to 3.44.4 2017-12-25 16:26:13 +01:00
pyup-bot
c5c3684581 Update setuptools from 38.2.4 to 38.2.5 2017-12-25 16:26:11 +01:00
RyanJenkins
d9b00acdc6 Return focus to qutebrowser when external editor finishes. 2017-12-23 23:59:02 -08:00
Ryan Farley
46f6336e6e and add back needed connection 2017-12-22 12:47:38 -06:00
Ryan Farley
1d0b91475d remove broken connection 2017-12-22 12:45:37 -06:00
Ryan Farley
611f3621ec skip test
tests/end2end/features/test_marks_bdd.py::test_jumping_back_after_following_a_link
2017-12-22 12:36:45 -06:00
Ryan Farley
252fbf651f add back blank line for D204 2017-12-22 11:47:13 -06:00
Ryan Farley
f90342741a comma spacing 2017-12-22 11:41:07 -06:00
Ryan Farley
feb327e80e fix style issues, better names, less indirection
Added spaces to comments, use python naming conventions, remove
_load_progress_fake as unnecessary, rename _on_load_*_fake to
_on_load_*_workaround (for less confusion), and use qtutils rather than
QT_VERSION_STR
2017-12-22 11:32:31 -06:00
seebye
125af531cb database qute://back 2017-12-22 15:44:42 +01:00
Ryan Farley
fa10b76ce8 remove extraneous loadStarted connection
Copying and pasting without thinking might lead to redundancy.
2017-12-22 01:27:35 -06:00
Ryan Farley
4a6c9ecc34 only reroute load signals with Qt=5.10
This stops regressions on Qt<=5.9. It also reintroduces #3110, but
fixing #3110 was just a nice side effect rather than the main goal here.
2017-12-21 21:22:20 -06:00
Ryan Farley
d6c56b83a8 fix line length 2017-12-21 16:31:45 -06:00
Ryan Farley
5bfab54828 supplement broken webengine load signals
This uses the much more reliable `loadProgress(100)` in place of
`loadFinished(true)` for WebEngine, with `loadProgressFake` and
`loadFinishedFake` used instead of the 'official' variants.
2017-12-21 15:35:43 -06:00
Florian Bruhin
5c00eea122 Fix stripping of lines in asciidoc2html
This broke in #3382 since re.fullmatch does a different thing for trailing
newlines:

    >>> line
    '===========\n'
    >>> re.match(r'^=+$', line)
    <_sre.SRE_Match object; span=(0, 11), match='==========='>
    >>> re.fullmatch(r'=+', line)
    >>>

This now strips the line by default, and adds newlines if needed.
2017-12-20 11:35:27 +01:00
seebye
801b6b90ce pylint adjustments 2017-12-20 01:15:12 +01:00
seebye
c8ae405bfe fix #3396 2017-12-20 00:10:21 +01:00
Cody Scott
3c0d51c253 Fix broken link 2017-12-19 12:18:10 -05:00
Florian Bruhin
4ffdd9da0e Add new B008 to flake8 ignores 2017-12-19 08:57:33 +01:00
Florian Bruhin
fde0516ccf Merge remote-tracking branch 'origin/pr/3413' 2017-12-19 08:56:01 +01:00
Florian Bruhin
f2c93a0061 Use request instead of pytestconfig
This unifies QuteProc and the other Process subclasses a bit.
2017-12-19 08:55:35 +01:00
Florian Bruhin
12ba642547 Avoid using pytest.config
It's going to be removed in some future pytest release.
2017-12-19 08:32:32 +01:00
Jay Kamat
012e63520f Blacklist non-implemented qtwebkit frame features 2017-12-18 18:44:28 -08:00
Jay Kamat
b87f0b6f65 Add support for non-link buttons to test_hints 2017-12-18 17:04:50 -08:00
Jay Kamat
344ebed6ad Add iframe tests for insert on click and follow-selected 2017-12-18 11:00:03 -08:00
pyup-bot
23e3a5ef7d Update hypothesis from 3.42.1 to 3.44.1 2017-12-18 16:23:16 +01:00
pyup-bot
7d3645adc2 Update flake8-bugbear from 17.4.0 to 17.12.0 2017-12-18 16:23:15 +01:00
Florian Bruhin
dbb89b1073 Update docs 2017-12-18 16:11:29 +01:00
Florian Bruhin
f203535e00 Merge remote-tracking branch 'origin/pr/3407' 2017-12-18 16:11:16 +01:00
Ryan Roden-Corrent
ef2de8201a Fix colors.completion.fg default and description.
Update the description to mention the number of columns and change the
default to ["white", "white", "white"] to make it more obvious that
multiple colors can be specified. This also satisfies the config test
that expects the default value for ListOrValue types to be a list.

One other test had to be tweaked to use a config option that is still
just a QtColor rather than a ListOrValue.

While it is possible to provide just two colors, it is "undefined
behavior". It will use the first color as the third color, but that is
an artifact of the implementation and therefore not documented (though
also not an error, as it is harmless).
2017-12-18 08:42:22 -05:00
Ryan Roden-Corrent
31c2988693 Fix test_config.test_get for updated config.
colors.completion.fg is now a list instead of a QColor. As this test
specifically wanted to test a QColor, I just changed it to a different
config option.
2017-12-17 13:28:00 -05:00
Florian Bruhin
e66dce2360 Merge pull request #3402 from tbroadley/fix-typos
Fix typo
2017-12-16 17:28:18 +01:00
Thomas Broadley
3775bf929f Fix typos 2017-12-16 11:24:14 -05:00
Jay Kamat
6433096611 Disable max-lines in eslint 2017-12-15 21:30:08 -05:00
Florian Bruhin
d03e314762 Explain eslint philosophy 2017-12-15 23:26:18 +01:00
Florian Bruhin
b8a5c04b69 Clean up run_pylint_on_tests 2017-12-15 23:22:26 +01:00
Florian Bruhin
c506ffa4cd pylint: More config adjustments 2017-12-15 23:17:28 +01:00
Florian Bruhin
430126dcc8 pylint: Re-enable ungrouped-imports 2017-12-15 23:08:53 +01:00
Florian Bruhin
f5dd392701 Regenerate docs 2017-12-15 23:00:06 +01:00
Jay Kamat
7f9d4888fd Fix a couple eslint errors
Restructure serialize_elem into a bunch of smaller functions
2017-12-15 15:55:16 -05:00
Jay Kamat
2898c416aa Simplify and clean up frame logic 2017-12-15 15:16:18 -05:00
Florian Bruhin
21bf446147 Reorder pylint ignores 2017-12-15 20:06:12 +01:00
Florian Bruhin
e65c0dd8a7 pylint: Re-enable bad-continuation
And lots and lots of whitespace changes.
2017-12-15 19:16:55 +01:00
Florian Bruhin
93cd200bb7 Add docstring 2017-12-15 19:06:23 +01:00
Florian Bruhin
4c24b9ed4a Reorder pylint disables 2017-12-15 17:16:55 +01:00
Florian Bruhin
26a622c46d Disable wrong inconsistent-return-statements 2017-12-15 16:33:47 +01:00
Florian Bruhin
f4ed31b295 Add an utils.Unreachable exception 2017-12-15 16:33:47 +01:00
Florian Bruhin
016fc0ebb1 Fix some inconsistent returns 2017-12-15 16:33:47 +01:00
Florian Bruhin
97a4e8d847 Rewrite error handling in hist_importer script
Raise an exception instead of calling sys.exit
2017-12-15 16:33:47 +01:00
Florian Bruhin
1a4a9b4392 Declare *args before keyword arguments
See https://pylint.readthedocs.io/en/latest/whatsnew/1.8.html
2017-12-15 16:33:47 +01:00
Florian Bruhin
fc987ea9c0 Make message.confirm_async keyword-only 2017-12-15 14:49:49 +01:00
Florian Bruhin
79717528ec Fix exception message formatting 2017-12-15 14:42:37 +01:00
Florian Bruhin
7cebd95936 Simplify test_getitem 2017-12-15 14:41:38 +01:00
Florian Bruhin
bb44f1d4cc Remove old pylint disables 2017-12-15 14:39:42 +01:00
Florian Bruhin
e76732693c Fix wrong import order 2017-12-15 14:35:07 +01:00
Florian Bruhin
a4101662b2 pylint: Disable logging-not-lazy
We log to RAM anyways
2017-12-15 14:29:50 +01:00
Florian Bruhin
3f9ded3bed Add missing docstrings 2017-12-15 13:55:06 +01:00
Florian Bruhin
03a339b93a Update pylint 2017-12-15 13:42:54 +01:00
Florian Bruhin
8173a48b8a Don't access stale settings object after hinting
When QtWebEngine shuts down, it calls pending callbacks, which means we access
an invalid 'settings' object when that happens. The stack would look something
like this:

0  QtWebEngineCore::WebEngineSettings::setAttribute(QtWebEngineCore::WebEngineSettings::Attribute, bool)
12 QtWebEngineCore::CallbackDirectory::invokeEmptyInternal<QVariant const&>(QtWebEnginePrivate::QWebEngineCallbackPrivateBase<QVariant const&>*)
14 QtWebEngineCore::CallbackDirectory::~CallbackDirectory()
19 QWebEnginePage::~QWebEnginePage()

If we instead get the settings from the view freshly, we get a RuntimeError from
PyQt telling us that it's dead. Not sure why it doesn't know about settings
being dead...

With that, we'd get a RuntimeError, which we can simply ignore as it doesn't
matter anyways if the tab is gone.

Fixes #3399
2017-12-14 22:56:44 +01:00
Florian Bruhin
76db8d6f81 Make webelem.OrphanedError subclass of webelem.Error
This means something like this:

  :hint ;; later 20 follow-hint a ;; later 20 tab-close

Won't crash anymore, as the webelem.Error will be shown in the statusbar.
2017-12-14 22:43:19 +01:00
Florian Bruhin
dc1d5036b6 Simplify scrollbar width calculation
This gives us slightly different values it seems, but I think they are more
correct (and don't need the "+ 5" above).

Taking the width directly (not the sizeHint width) returned values like 100 or
so when the scrollbar wasn't shown yet, so that seems wrong.
2017-12-14 09:39:07 +01:00
Florian Bruhin
58043b5653 Always subtract scroll bar width from completion view
The situation where there's no scroll bar at the point the column widths are
calculated is a very rare one. What happens more often is that the scroll bar
disappears due to filtering, in which case we didn't recalculate the column
widths anyways.

Furthermore, we can even go wrong with this calculation, when we calculate the
column widths while the entire completion is invisible - then the scroll bar
won't be visible either, and we won't subtract the space needed for it.

Let's not try to optimize for this uncommon case, and just always subtract the
scrollbar, even if it's not there initially.

Fixes #3359
Closes #3389
2017-12-14 09:13:34 +01:00
Florian Bruhin
f0ad24b08a Remove long deprecated :download invocation 2017-12-14 09:06:46 +01:00
Florian Bruhin
dce4c68827 Update docs 2017-12-14 09:03:51 +01:00
Florian Bruhin
43588b2818 Merge remote-tracking branch 'origin/pr/3393' 2017-12-14 09:02:31 +01:00
Florian Bruhin
5620acb81f Update Debian install instructions
[ci skip]
2017-12-14 08:59:54 +01:00
Florian Bruhin
ac7b56b2b8 Merge remote-tracking branch 'origin/pr/3392' 2017-12-13 23:05:40 +01:00
Ryan Roden-Corrent
57e2d407ce Support different colors per completion column.
Now colors.completion.fg may be set to a list to specify a different
color for each completion column. For example:

:set colors.completion.fg [black,blue,white] will use black text for the
first column, blue for the second, and white for the third.

Setting to a single value still works and behaves as before. The default
is unchanged from 'white'.

Resolves #1794.
2017-12-13 17:03:59 -05:00
Florian Bruhin
7a3554e77a Stabilize :session-save --quiet test
By adding a way to check for the loglevel, we can easily check there's no
message but still wait for the session to be saved.
2017-12-13 23:02:44 +01:00
Florian Bruhin
f34bdfbb50 Revert "Remove :session-save --quiet test"
This reverts commit bea71ed3a2.
I think I can think of a way to stabilize it now.
2017-12-13 22:46:38 +01:00
Ryan Roden-Corrent
12112e0fc7 Implement command-accept --rapid.
command-accept --rapid will run the command without clearing the prompt,
allowing "rapid fire" commands. For example, one could open completion
for `open -t` and open several tabs in a row.

The default binding is ctrl+enter.

Resolves #588.
2017-12-13 16:30:42 -05:00
Florian Bruhin
0a612db733 Rename/move encoding test 2017-12-13 21:13:47 +01:00
Florian Bruhin
ddcdfa54aa Fix test for invalid guiprocess encoding 2017-12-13 21:12:56 +01:00
Kevin Velghe
cc4e8c1aae fix password_fill using libsecret 2017-12-13 21:06:09 +01:00
Florian Bruhin
922b1e8f10 Use system locale to decode subprocess output 2017-12-13 20:09:56 +01:00
Florian Bruhin
07d07c7fae Update changelog 2017-12-13 20:06:43 +01:00
Florian Bruhin
2b3250144b Merge remote-tracking branch 'origin/pr/3388' 2017-12-13 20:06:00 +01:00
Florian Bruhin
cdb90cbee7 Regenerate docs 2017-12-13 19:59:54 +01:00
Florian Bruhin
afb0807064 Update changelog 2017-12-13 19:58:01 +01:00
Florian Bruhin
f32b4d88ba Merge remote-tracking branch 'origin/pr/3385' 2017-12-13 19:56:53 +01:00
George Edward Bulmer
84e0ce757a Fix erroneous docstring in a recently added test. 2017-12-13 14:50:25 +00:00
Ryan Roden-Corrent
6420037dd9 Fix histcategory query reuse logic.
I mistakenly checked the length of wheres instead of words. This fixes
that check, renames 'wheres' to 'where_clause' to be clear
that it is a string and not an array, and adds a test.
2017-12-13 08:39:34 -05:00
Ryan Roden-Corrent
2e36e5151e Fix comment in histcategory. 2017-12-13 08:21:48 -05:00
George Edward Bulmer
28961ab177 Add a test with invalid unicode in spawned stdout.
stderr features identical behaviour, so is currently untested.
2017-12-13 12:46:46 +00:00
Florian Bruhin
4caf2fd8b7 Update changelog 2017-12-13 09:27:25 +01:00
Florian Bruhin
c8aef015b0 Merge remote-tracking branch 'origin/pr/3201' 2017-12-13 09:22:36 +01:00
Florian Bruhin
31e3356d01 Merge remote-tracking branch 'origin/pr/3382' 2017-12-13 08:43:21 +01:00
Florian Bruhin
bea71ed3a2 Remove :session-save --quiet test
When nothing gets logged, we can't check whether the session was already saved.
2017-12-13 08:41:29 +01:00
Ryan Roden-Corrent
ae294e92ad Remove unused re import 2017-12-12 20:27:06 -05:00
Ryan Roden-Corrent
8358c76f86 Fix casing of LIKE in comment 2017-12-12 20:26:30 -05:00
Ryan Roden-Corrent
158cfa1194 Clean up "any order" SQL query code.
- Replace a list with a generator
- Add commments to the less obvious parts
- Simplify the binding variable names
2017-12-12 17:28:38 -05:00
George Edward Bulmer
16a9948759 Replace malformed utf-8 characters in spawn output.
Previously this simply crashed if there was ever malformed utf-8 in the
stderr or stdout streams, perhaps as a result of an incorrectly spawned
command. See e.g. #3222
2017-12-12 22:23:33 +00:00
Florian Bruhin
19596e3104 Make qute://log lines darker 2017-12-12 22:52:35 +01:00
George Edward Bulmer
4844a68bfc Change a rogue re.fullmatch into a re.search.
Sometimes tests were timing out. Perhaps with fullmatch these tests were
rarely failing to parse the logs for the information.
2017-12-12 21:42:10 +00:00
Justin Partain
8f5394934f Fix bad merge when rebasing incremental_search feature 2017-12-12 11:32:52 -05:00
Justin Partain
aff6510e35 Refactor _incremental_search() based on PR review 2017-12-12 11:31:28 -05:00
Justin Partain
bcd9d13684 Update tests to use search.ignore_case 2017-12-12 11:31:28 -05:00
Justin Partain
9f511fe18c pylint fix, change if len(text) to if text 2017-12-12 11:31:28 -05:00
Justin Partain
8451899a76 Add block for ignore_case 2017-12-12 11:31:28 -05:00
Justin Partain
4eebd2a85d Create config.search.* group with ignore_case and incremental 2017-12-12 11:31:28 -05:00
Justin Partain
bb2fcddcd4 Update incremental_search PR with changes from review 2017-12-12 11:31:28 -05:00
Justin Partain
77054cc063 Make 'Text not found on page!' warnings replace 2017-12-12 11:31:28 -05:00
Justin Partain
c1094b6660 Feature - incremental_search
Added config option to find on a page incrementally, renewing the search
each time a new character is entered.
2017-12-12 11:31:28 -05:00
George Edward Bulmer
9ca6baca4f Modify instances of re.match to fullmatch or search.
This applies the changes to the tests directory only.
2017-12-12 15:07:37 +00:00
Florian Bruhin
22434f4d1b Merge pull request #3386 from ykgmfq/patch-1
Fedora instructions for non-free codecs
2017-12-12 15:57:39 +01:00
ykgmfq
dadf6c0e0a Fedora instructions for non-free codecs 2017-12-12 15:53:17 +01:00
George Edward Bulmer
b07a4c8c28 Add explicit left anchor to directory check regex. 2017-12-12 13:25:35 +00:00
George Edward Bulmer
3cf4e8ba67 Merge remote-tracking branch 'upstream/master' into regex-match 2017-12-12 13:22:11 +00:00
Ryan Roden-Corrent
6a20f9d4c9 Cache url query when possible.
We don't need to regenerate a new query every keystroke, but rather
every time the user adds a new word.
2017-12-12 07:37:31 -05:00
Florian Bruhin
5fe91c30cc Fix :click-element with an ID containing non-alphanumeric characters
See #3201
2017-12-12 11:33:59 +01:00
Florian Bruhin
2e8acf4825 Improve terminating of test processes
There are various small changes here:

- If the process is already finished, we don't try to terminate it.
- On Windows, we use QProcess::kill instead of QProcess::terminate, as terminate
  will only work with processes which have a GUI loop.
- We assert that quitting the suprocess actually worked.

Fixes #3384
2017-12-12 09:36:28 +01:00
Florian Bruhin
6655793e6a Use 'terminate' to clean up webserver subprocess
We already have TestProcess.terminate which does exactly the same
WebserverProcess.cleanup does.

See #3384
2017-12-12 09:33:34 +01:00
Florian Bruhin
5a97e79099 Update changelog 2017-12-12 07:05:55 +01:00
Florian Bruhin
12f6304659 Fix indent 2017-12-12 07:03:48 +01:00
Florian Bruhin
8e319a762f Merge remote-tracking branch 'origin/pr/3374' 2017-12-12 07:03:10 +01:00
Florian Bruhin
4f2f1a6494 Make sure editor test doesn't run on Windows 2017-12-12 06:57:39 +01:00
Florian Bruhin
1587181a76 Merge remote-tracking branch 'origin/pr/3380' 2017-12-12 06:51:53 +01:00
Florian Bruhin
81bfa81448 Don't run end2end tests on macOS anymore
They are just too flaky on macOS to be useful, and I have no idea how to make
things more stable there
2017-12-12 06:45:47 +01:00
George Edward Bulmer
f74832328f Modify re.match usage in scripts directory. 2017-12-11 23:06:52 +00:00
George Edward Bulmer
747a9bc5b6 Modify usage of re.match to fit re.fullmatch or re.search.
re.match features an implicit left anchor, which can be surprising.

re.fullmatch features implicit anchors on both sides, but is aptly named
and unsurprising.

re.search has no such implicit anchors, which ought to be the default
even if a single anchor is needed.
2017-12-11 21:32:55 +00:00
Florian Bruhin
481dec067d Don't override background-color for qutebrowser pages
Fixes #3381
2017-12-11 17:38:12 +01:00
pyup-bot
d114deac70 Update werkzeug from 0.12.2 to 0.13 2017-12-11 16:23:21 +01:00
pyup-bot
d57a81a3d3 Update pytest from 3.3.0 to 3.3.1 2017-12-11 16:23:19 +01:00
pyup-bot
22fe42d38e Update hypothesis from 3.40.1 to 3.42.1 2017-12-11 16:23:18 +01:00
pyup-bot
5d8e3a969f Update cheroot from 5.10.0 to 6.0.0 2017-12-11 16:23:16 +01:00
pyup-bot
713a2ef2c1 Update pylint from 1.7.4 to 1.7.5 2017-12-11 16:23:15 +01:00
pyup-bot
519dc6a7c9 Update setuptools from 38.2.3 to 38.2.4 2017-12-11 16:23:13 +01:00
pyup-bot
dd7a082265 Update codecov from 2.0.9 to 2.0.10 2017-12-11 16:23:12 +01:00
George Edward Bulmer
a2bcd68d56 Code review changes.
This fixes whitespace and alignment issues, and removes a stray test.
2017-12-11 13:35:39 +00:00
Ryan Roden-Corrent
8909e03f1c Match url completion terms in any order.
Perviously, 'foo bar' would match 'foo/bar' but not 'bar/foo'. Now it
will match both, using a query with a WHERE clause like:

WHERE ((url || title) like '%foo%' AND (url || title) like '%bar%')

This does not seem to change the performance benchmark. However, it does
create a new query for every character added rather than re-running the
same query with different parameters. We could re-use queries if we
maintained a list like self._queries=[1_arg_query, 2_arg_query, ...].
However, it isn't clear that such a complexity would be necessary.

Resolves #1651.
2017-12-11 07:46:50 -05:00
Florian Bruhin
72d847d687 travis: Use newer macOS image 2017-12-11 09:36:27 +01:00
Florian Bruhin
6a7d2f4275 Remove dead code
QUrl.path() never returns None
2017-12-11 09:14:26 +01:00
Florian Bruhin
f7a94b946f Add changelog for font size change
See 22f3fade24
2017-12-11 08:12:13 +01:00
Florian Bruhin
444f0a36df Update docs 2017-12-11 07:12:45 +01:00
Florian Bruhin
2a8b74cbec Get rid of FakeUrl stub
We can just use a real QUrl...
2017-12-11 07:10:17 +01:00
Florian Bruhin
6c7b8ce895 Merge remote-tracking branch 'origin/pr/3370' 2017-12-11 07:09:49 +01:00
George Edward Bulmer
3b10584749 Update tests to work with the earlier consumption of stdin etc.
Note: this adds an element to vulture's whitelist that vulture
mistakenly identified as unused.
2017-12-10 23:46:35 +00:00
George Edward Bulmer
d32a4ea99e Seperate _output from guiprocess and keep window opening in spawn.
This removes the extraneous variable, and makes testing easier.
2017-12-10 23:45:43 +00:00
George Edward Bulmer
038bb85a67 Capture stdout and stderr always for spawn.
This change makes it so that stderr and stdout is unconditionally read
from for a completed process, and sent to qute://spawn-output. This
allows the user to see the results of the previous process, even if they
had forgotten to use --output.
2017-12-10 19:12:47 +00:00
George Edward Bulmer
9f8dbe95e4 Code review changes.
This fixes the following problems found in a review:

1. Manual modification of the asciidoc has been undone.
2. --output-to-tab has been renamed to the less verbose --output.
3. spawn_output has been changed to spawn-output in the url.
4. Erroneous newline in imports has been removed.
5. output in guiprocess.py has been marked private.
6. If there is no output for either stderr or stdout, say so.
7. Missing space in a text line was added.
8. Redundant initialising of an empty string removed.
2017-12-08 19:00:46 +00:00
George Edward Bulmer
9f9311840a Add --output-to-tab flag for :spawn.
This puts the exit status, stdout, and stderr in a new tab.
2017-12-08 18:00:07 +00:00
evanlee123
9685eb36b6 Changed FakeUrl's url command to toDisplayString 2017-12-07 16:30:34 -07:00
unknown
25526f00bf fixed catch error in tabwidget 2017-12-07 15:47:03 -07:00
unknown
2483b8315c Merge remote-tracking branch 'refs/remotes/origin/master' 2017-12-07 13:36:49 -07:00
Jay Kamat
5c5f992821 Implement find_id inside frames
Fixes :click-element
2017-12-07 14:53:15 -05:00
Jay Kamat
825939633a Implement follow_selected in frames 2017-12-07 14:46:18 -05:00
Jay Kamat
0fc99108bf Implement iframe support for clicking elements 2017-12-07 14:32:08 -05:00
Jay Kamat
052823b74c Fix broken width and height location in frames 2017-12-07 13:03:06 -05:00
Jay Kamat
c737d7ab22 Fix various js problems with frame support 2017-12-07 12:47:51 -05:00
Artur Shaikhullin
a8d79fedf3 Fix fetching selection 2017-12-07 17:45:05 +06:00
Artur Shaikhullin
5f1e0224a9 Pass caret tests 2017-12-07 17:30:32 +06:00
evanlee123
18609f1a24 fixed spacing on FakeURL 2017-12-07 02:36:31 -07:00
evanlee123
d1a00eb934 Clarity on protocol field 2017-12-07 02:35:34 -07:00
evanlee123
20ac618752 Simplified code in get_tab_fields
changed self.tab_url(idx) to url in get_tab_fields()
2017-12-07 02:04:02 -07:00
Florian Bruhin
d4cadcc62e Add comment about @run-at
[ci skip]
2017-12-07 08:17:15 +01:00
evanlee123
4d13941290 added the scheme field to FakeURL 2017-12-06 23:57:19 -07:00
evanlee123
02b24e8dfb Update tabwidget.py 2017-12-06 21:35:09 -07:00
Jay Kamat
d4001a4a98 Add support for hinting elements from within same-origin frames 2017-12-06 23:02:00 -05:00
unknown
f0de3601cb Merge remote-tracking branch 'upstream/master' 2017-12-06 13:37:05 -07:00
unknown
94809032a4 field[protocol] gives the right protocol] 2017-12-06 13:24:27 -07:00
Florian Bruhin
0f20f16b15 Merge branch 'greasemonkey' 2017-12-06 21:24:15 +01:00
Florian Bruhin
f033b228b1 Use py.path.local in save_script 2017-12-06 21:21:55 +01:00
unknown
30b25da273 Added protocol key to field 2017-12-06 13:09:44 -07:00
Florian Bruhin
04d2004528 tox: Fix eslint environment
We need to set basepython there to not get InterpreterNotFound
2017-12-06 20:58:14 +01:00
Florian Bruhin
eb90f9835f Mark qute://settings test as flaky 2017-12-06 20:54:14 +01:00
Florian Bruhin
d6039a0e34 Fix markers for editor test 2017-12-06 20:30:46 +01:00
Florian Bruhin
6aafe02320 Make sure scripts are removed correctly 2017-12-06 20:18:41 +01:00
Florian Bruhin
a37ecc353c Simplify for loop 2017-12-06 20:18:41 +01:00
Florian Bruhin
2633dcc0d5 Fix lint 2017-12-06 20:18:41 +01:00
Florian Bruhin
dd63508be7 Add a greasemonkey.init()
This also creates the greasemonkey directory if it doesn't exist yet, for
discoverability.
2017-12-06 11:55:08 +01:00
Florian Bruhin
0c792d228e Update docs 2017-12-06 11:12:25 +01:00
Florian Bruhin
3cd2910fa2 Merge branch 'greasemonkey' of https://github.com/toofar/qutebrowser into greasemonkey 2017-12-06 10:47:29 +01:00
Artur Shaikhullin
890e26b2b5 Additional fixes 2017-12-06 13:58:23 +06:00
Jimmy
6b3e16b163 Greasemonkey: mark failing no(sub)frames test as flaky.
This test is supposed to ensure that user scripts don't run on iframes
when the @noframes directive is set in the greasemonkey metadata. It is
failing sometimes on travis but passing on local test runs. Personally I
haven't actually ran the whole test suite through, just the javascript
tests. It maybe be some stale state that only shows up when you run the
whole suite. It may be some timing issue that only shows up on travis
because ???. Hopefully this stops the red x from showing up on the PR.
2017-12-06 20:34:29 +13:00
Jimmy
ead108eeeb fixup! Greasemonkey: Add run-at document-idle. 2017-12-06 20:27:56 +13:00
Jimmy
129f97873a Greasemonkey: add assert to tests scripts_for assumptions.
And crash the users browsing session as a result of any accidental and
totally, otherwise, non-fatal unforseen errors.
2017-12-06 20:21:29 +13:00
Florian Bruhin
7d7c841250 Update changelog 2017-12-06 08:01:39 +01:00
Florian Bruhin
1a3f8662e6 Improve handling of cancelled search callbacks 2017-12-06 07:56:59 +01:00
Florian Bruhin
9ec4e749f1 Merge branch 'fix_search_callbacks' of https://github.com/jupart/qutebrowser 2017-12-06 07:51:19 +01:00
Florian Bruhin
a3ba7b9f60 Reformat hist_importer epilog. 2017-12-06 07:45:52 +01:00
Florian Bruhin
16e09d18fa Update changelog 2017-12-06 07:42:07 +01:00
Florian Bruhin
549a3a8f70 Improve hist_importer messages 2017-12-06 07:41:41 +01:00
Florian Bruhin
6ea250dc83 Merge remote-tracking branch 'origin/pr/3044' 2017-12-06 07:17:22 +01:00
Artur Shaikhullin
ed1d036077 Fix eslint warnings
used some eslint ignore comments
2017-12-06 12:11:06 +06:00
Florian Bruhin
b326f12427 Mark editor test as flaky
See #3367
2017-12-06 06:59:08 +01:00
Florian Bruhin
9c042e4313 Update changelog 2017-12-06 06:58:22 +01:00
Florian Bruhin
0df1d07558 Merge remote-tracking branch 'origin/pr/3367' 2017-12-06 06:57:59 +01:00
Florian Bruhin
58212a7b15 Update docs 2017-12-06 06:56:12 +01:00
Florian Bruhin
7a6d568c8c Remove blank line 2017-12-06 06:53:27 +01:00
Florian Bruhin
7f81f0c0ab Always open session tabs in foreground
This helps with issues with lazy sessions as document.hidden was set
incorrectly.

See #3345, #3366
2017-12-06 06:51:15 +01:00
Florian Bruhin
dcb4448594 Merge remote-tracking branch 'origin/pr/3345' 2017-12-06 06:51:03 +01:00
Justin Partain
00a09354c3 Track number of active searches in tab, ignore all but most recent search callbacks 2017-12-05 08:28:10 -05:00
Ryan Roden-Corrent
636f9edff6 History completion by both URL and title.
Resolves #1649.
2017-12-05 07:32:58 -05:00
Florian Bruhin
e97fbfdf56 Merge remote-tracking branch 'origin/pr/3355' 2017-12-05 13:22:36 +01:00
Florian Bruhin
8a3437c6a4 Adjust Debian install instructions 2017-12-05 09:36:14 +01:00
Florian Bruhin
29c2e7b45f Skip :follow-selected tests on Qt 5.10
See #3003, #2635
2017-12-05 08:35:12 +01:00
Florian Bruhin
0ce9a355ae Fix download test with Qt 5.10
Not sure why this is needed (no prompt is shown otherwise), but it works like
this.

This probably is related to https://bugreports.qt.io/browse/QTBUG-63388

See #3003
2017-12-05 08:34:37 +01:00
Florian Bruhin
62228752aa Fix most end2end tests with Qt 5.10
For some reason, if we don't wait for about:blank to be fully loaded with
Qt 5.10, we get the next LoadStatus.finished notification with about:blank as
URL.

This is most likely caused by the changes in
https://codereview.qt-project.org/#/c/202924/

See #3003
2017-12-05 08:34:33 +01:00
Florian Bruhin
a8f4444c24 tests: Show more of the message 2017-12-04 22:07:49 +01:00
Florian Bruhin
b554e1f763 tests: Add after= argument to wait_for 2017-12-04 22:07:23 +01:00
François Chavant
9675ea93ee Do not call pip in travis_install.sh when TESTENV=shellcheck 2017-12-04 20:31:28 +01:00
mhm@mhm.com
02104a318e delay added, text changed 2017-12-04 19:03:12 +01:00
mhm@mhm.com
28caddf3c1 delay added, text changed 2017-12-04 19:02:09 +01:00
Florian Bruhin
3a04de62ae Recompile requirements 2017-12-04 19:01:21 +01:00
François Chavant
86c37538d7 Simply search for shell scripts to search
Use 2 simpler find commands and redirect the output to a temporary
file.
2017-12-04 18:29:55 +01:00
François Chavant
4467f51e42 Use 'language: generic' for shellcheck, fix typo, correct indentation 2017-12-04 18:15:02 +01:00
Josefson Fraga
b6466b7410 revision 2 2017-12-04 13:08:56 -03:00
Florian Bruhin
6973a703c5 Add pluggy to requirements 2017-12-04 16:56:39 +01:00
Florian Bruhin
2cdc32ca58 Remove pytest-catchlog 2017-12-04 16:55:57 +01:00
pyup-bot
956c257d19 Update pytest-travis-fold from 1.2.0 to 1.3.0 2017-12-04 16:09:25 +01:00
pyup-bot
71095da975 Update pytest from 3.2.5 to 3.3.0 2017-12-04 16:09:23 +01:00
pyup-bot
a0caa2b7b1 Update hypothesis from 3.38.5 to 3.40.1 2017-12-04 16:09:22 +01:00
pyup-bot
f7ccb8061b Update pyroma from 2.2 to 2.3 2017-12-04 16:09:20 +01:00
pyup-bot
96b6f7c443 Update macholib from 1.8 to 1.9 2017-12-04 16:09:19 +01:00
pyup-bot
a3612a624a Update altgraph from 0.14 to 0.15 2017-12-04 16:09:17 +01:00
pyup-bot
905748f2d0 Update setuptools from 38.2.1 to 38.2.3 2017-12-04 16:09:16 +01:00
pyup-bot
a3f57b9a9b Update flake8-builtins from 1.0 to 1.0.post0 2017-12-04 16:09:14 +01:00
Florian Bruhin
7ef64c0f87 Read $PYTHON in every tox.ini environment
See #2341
2017-12-04 06:45:47 +01:00
Florian Bruhin
2c2d7fe734 Copy-paste pylint commands for second environment
Otherwise, tox 2.3.1 (shipped with various distributions) fails with:

    tox.ConfigError: ConfigError: substitution key 'posargs' not found
2017-12-04 06:36:42 +01:00
Florian Bruhin
6b65d96fe1 Reformat comment 2017-12-04 06:32:54 +01:00
Florian Bruhin
fe60556a34 Merge remote-tracking branch 'origin/pr/3349' 2017-12-04 06:32:46 +01:00
Florian Bruhin
a137a29cce Style improvements
This adds a blank line and makes Completer arguments keyword-only to make their
meaning more clear.
2017-12-03 22:32:17 +01:00
Florian Bruhin
9dfff43d99 Merge remote-tracking branch 'origin/pr/3357' 2017-12-03 22:30:47 +01:00
Florian Bruhin
bbc2f14e45 Merge remote-tracking branch 'origin/pr/3356' 2017-12-03 22:30:30 +01:00
Ryan Farley
38b2d42b40 cleanup PYTEST_ADDOPTS for pytest subprocess
See https://github.com/qutebrowser/qutebrowser/pull/3349
2017-12-03 15:09:47 -06:00
Ryan Roden-Corrent
b610563e7f Don't show current window for :tab-give/:tab-take.
Resolves #3144.
2017-12-03 08:03:54 -05:00
Florian Bruhin
97054ca35d Don't hide report dialog early
It looks like hiding it already causes it to be accepted.
Fixes #1128
2017-12-03 13:04:08 +01:00
Florian Bruhin
f07301cfb5 Revert "Restart correctly after reporting crash."
This reverts commit 7001f068b3.
2017-12-03 12:48:29 +01:00
François Chavant
59c9a2b243 Ignore shellcheck false positive 2017-12-03 11:30:59 +01:00
François Chavant
22e4a800a1 Refactor format_json userscript to not parse 'ls' output
The script now also works under MacOS
2017-12-03 10:50:54 +01:00
François Chavant
ccb8e74998 Use koalaman/shellcheck:latest 2017-12-03 09:29:38 +01:00
François Chavant
dd589f180b Fix remaining shellcheck warnings 2017-12-02 21:09:24 +01:00
François Chavant
31710b7045 Trivial fixes for shellcheck warnings 2017-12-02 19:37:20 +01:00
François Chavant
595a53ad3b Apply patch from #1697 2017-12-02 19:37:18 +01:00
François Chavant
b91a39be22 Run shellcheck on Travis CI 2017-12-02 19:37:10 +01:00
Florian Bruhin
ce46b30a1e Show error instead of warning 2017-12-02 14:49:06 +01:00
Florian Bruhin
f1f573d651 Update changelog 2017-12-02 14:48:31 +01:00
Florian Bruhin
003ec31848 Merge remote-tracking branch 'origin/pr/3333' 2017-12-02 14:47:24 +01:00
Florian Bruhin
a41db970e8 Update changelog
[ci skip]
2017-12-02 14:42:14 +01:00
Florian Bruhin
689fe96393 Improve workaround comment 2017-12-02 14:37:59 +01:00
Florian Bruhin
e9be357104 Merge remote-tracking branch 'origin/pr/3352' 2017-12-02 14:37:01 +01:00
Ryan Farley
fbd325f8d1 Revert "update tox env name in CI config"
This reverts commit 2f231c86ac.
2017-12-01 10:55:08 -06:00
Ryan Farley
5607cc2be8 Revert "update contributing.asciidoc with -pyqtlink envs"
This reverts commit 6b76203780.
2017-12-01 10:52:58 -06:00
Ryan Farley
df6ff55b7a allow pytest to default to link_pyqt
link_pyqt now checks for LINK_PYQT_SKIP, allowing pytest env names like
`py36` to work properly without negative conditionals in tox.ini
2017-12-01 10:51:41 -06:00
Ryan Roden-Corrent
780ac3f4c2 Remove needles quteproc/server fixture deps.
A few step definitions listed these in the parameters although they were
unused.
2017-12-01 11:34:47 -05:00
Ryan Roden-Corrent
3cfa0f7586 Make pylint happy for test_editor_bdd.
windows has no SIGUSR1, but we don't run this on windows anyways
for posix, there IS a member so we need to ignore useless-suppression
2017-12-01 08:41:08 -05:00
Ryan Roden-Corrent
1102ae4d7e Skip editor orphaned test on windows.
Tried SIGINT/SIGTERM, neither worked. Just skip this test on windows and
go back to SIGUSR1 otherwise.
2017-12-01 07:35:13 -05:00
Ryan Roden-Corrent
822f6bae2c Fix webkitelem test.
Now that it checks tab.is_deleted we need to mock that.
2017-12-01 07:28:02 -05:00
Ryan Farley
49485ca220 tox.ini: fix conditional syntax errors
`{[testenv]deps}` was passing conditionals in their raw form; this
simply lists them manually to avoid this.
2017-11-30 16:58:14 -06:00
Ryan Farley
6b76203780 update contributing.asciidoc with -pyqtlink envs 2017-11-30 14:21:37 -06:00
Ryan Farley
a5d0b9851a tox.ini: remove pyqt5.6, use requirements-pyqt.txt 2017-11-30 14:14:11 -06:00
mhm@mhm.com
b58cfead05 style fixed 2017-11-30 16:05:01 +01:00
Artur Shaikhullin
4eda328a61 Fix some lint warnings. Enable caret tests 2017-11-30 20:38:38 +06:00
Ryan Farley
2f231c86ac update tox env name in CI config
Use py36-pyqtlink instead of py36 for macOS
2017-11-30 08:35:02 -06:00
Ryan Farley
f7b0ac503e generate pytest envs with tox factors
This eliminates all separate pytest envs in favor of conditionals in
[testenv]. This requires renaming some environments to make the lack of
certain functionality explicit:

- instead of omitting pyqt{version}, use pyqtlink to use host PyQt

tox.ini: eliminate -nocov

It is possible to set the `PYTEST_ADDOPTS` environment variable to
enable coverage checks, rather than a new command.
2017-11-30 08:29:00 -06:00
Ryan Roden-Corrent
4497f710f9 Try SIGINT instead of SIGTERM for windows. 2017-11-30 07:56:37 -05:00
Artur Shaikhullin
c7a5dd6abb Clean up javascript caret code 2017-11-30 18:02:50 +06:00
Florian Bruhin
45a1989a1f Add some more links to initial readme line
[ci skip]
2017-11-30 01:26:44 +01:00
mhm@mhm.com
d29cf1ee4d lazy sessions, restore if visible, forward user after restore 2017-11-30 00:09:28 +01:00
Florian Bruhin
ac89ab23a9 Revert "Add nEXT to list of alternatives"
It uses a buggy legacy WebKit...
This reverts commit 814a88b741.
2017-11-29 22:36:06 +01:00
Florian Bruhin
2752055281 Fix lint in webserver_sub.py 2017-11-29 22:17:48 +01:00
Artur Shaikhullin
f965c0daec Don't position caret if selection exists 2017-11-29 21:01:47 +06:00
Artur Shaikhullin
70b58d1928 Inject caret css on mode enter 2017-11-29 20:07:24 +06:00
Ryan Roden-Corrent
b465c109ee Fix test_editor_bdd.py for windows.
- Use a raw string to handle windows path separators
- Use SIGTERM instead of SIGUSR1
2017-11-29 07:42:12 -05:00
Ryan Roden-Corrent
fcad40ceb7 Add orphaned tab check to WebKit as well.
This implements the orphaned editor fix for WebKit. Webkit wasn't
crashing before, but this causes webkit to show the same warning
webengine does if the editor is orhpaned (rather than silently
continuing). This allows the same BDD test to pass for both webkit and
webengine.
2017-11-29 07:35:11 -05:00
Ryan Roden-Corrent
e09a8c77e9 Simplify check for orphaned editor.
Instead of rewiring signals on tab.shutting_down, have the webelem check
if its parent tab is deleted, and throw a specific exception.

This is only necessary in WebEngine, Webkit does not crash when the
editor is orphaned.

I tried to write a test for is_deleted, but could not get it to pass:
```
def test_is_deleted(qtbot, view, config_stub, tab_registry, mode_manager):
    tab_w = Tab(win_id=0, mode_manager=mode_manager)
    qtbot.add_widget(tab_w)
    tab_w._set_widget(view)
    assert not tab_w.is_deleted()
    sip.delete(view)
    #assert tab_w.is_deleted()
```

The qtbot post-test cleanup would error due to the deleted view.
2017-11-29 07:01:48 -05:00
Florian Bruhin
81045fb1bd Drop unneeded parens 2017-11-29 10:44:50 +01:00
Florian Bruhin
af638ec430 Move hint unittests to their own file 2017-11-29 10:44:32 +01:00
Florian Bruhin
911616707e Merge remote-tracking branch 'origin/pr/3329' 2017-11-29 10:40:40 +01:00
Florian Bruhin
edba3f83bc Bump open_url_in_instance version to 1.0.4 2017-11-29 10:38:09 +01:00
Florian Bruhin
e7c4df7a9c Merge remote-tracking branch 'origin/pr/3332' 2017-11-29 10:38:06 +01:00
Rouji
afb4a6be51 bump _qb_version 2017-11-29 08:43:46 +01:00
Rouji
938198e92a quote _qute_bin (paths may contain whitespace), remove unnecessary --backend
argument
2017-11-29 08:43:02 +01:00
Rouji
d4291dd4ae don't 'exec' printf 2017-11-29 08:40:40 +01:00
Jay Kamat
19cecbdeae Fix style issues in scattered hint tests 2017-11-28 22:08:22 -05:00
Florian Bruhin
43ff35eaea Revert "Make sure docs are up-to-date for navigate.feature"
This action doesn't exist in navigate.feature

This reverts commit 3857491cf9.
2017-11-28 22:15:56 +01:00
Florian Bruhin
26edf55f85 Update install instructions for Fedora/OpenBSD 2017-11-28 17:56:17 +01:00
Florian Bruhin
3857491cf9 Make sure docs are up-to-date for navigate.feature 2017-11-28 17:06:41 +01:00
Florian Bruhin
ca74991900 Read backend after args.temp_settings
This should hopefully not affect any config change handlers, as almost nothing
is registered this early.

Fixes #3340
2017-11-28 17:00:45 +01:00
Ryan Roden-Corrent
01a9405391 Make ophaned editor test less flaky.
Instead of having the editor sleep a short time, explicitly send it a
signal to exit.
2017-11-28 08:38:04 -05:00
Ryan Roden-Corrent
9dfc6b0f61 Change wording for orphaned editor.
The term "vanished" is used elsewhere.
2017-11-28 08:37:38 -05:00
Ryan Roden-Corrent
b6dcd4d387 Reapply "Hide quickmark/bookmark completion if empty."
This reverts commit e72e8b8556.

Now that the SQL category works in isolation, it is possible to hide
quickmarks/bookmarks when those categories are empty.

Fixes #960
2017-11-28 07:21:26 -05:00
Florian Bruhin
b407f4ab41 Release v1.0.4 2017-11-28 10:56:15 +01:00
Florian Bruhin
9a8d68aa25 Mark :undo test as flaky
I don't get why it fails sometimes - so another @flaky stop-gap for now.
2017-11-28 09:19:37 +01:00
Florian Bruhin
93bdff5d40 Merge remote-tracking branch 'origin/pr/3330' 2017-11-28 08:29:17 +01:00
Florian Bruhin
56759cca6b Make more unit tests run with Qt 5.7.1 on a newer Linux 2017-11-28 08:16:07 +01:00
Florian Bruhin
0850aab96f Merge remote-tracking branch 'origin/pr/3337' 2017-11-28 07:58:42 +01:00
Florian Bruhin
1d17e7ab03 Update changelog 2017-11-28 07:04:57 +01:00
Florian Bruhin
ef1825efb0 Handle sqlite errors during :history-clear 2017-11-28 07:02:33 +01:00
Florian Bruhin
73587b1e16 Add SQLITE_CORRUPT to environmental SQL errors 2017-11-28 06:55:55 +01:00
Florian Bruhin
4fed8518e1 Handle "out of memory" error in sql.init() 2017-11-28 06:53:41 +01:00
Florian Bruhin
814a88b741 Add nEXT to list of alternatives
[ci skip]
2017-11-28 06:24:45 +01:00
Ryan Roden-Corrent
40e4e73e36 Ensure HistoryCategory works in isolation.
While QSortFilterProxyModel emits layoutChanged when changing the
pattern, QSqlQueryModel emits modelReset. As only layoutChanged was
connected, a HistoryCategory would only work in a model that also had at
least one ListCategory.

The simplest solution is to have the parent model emit the signal
directly. This also emits a single signal on a pattern change rather
that one for each child model.

Resolves #3016.
2017-11-27 11:49:32 -05:00
pyup-bot
9a8bac18ae Update pluggy from 0.5.2 to 0.6.0 2017-11-27 16:02:24 +01:00
pyup-bot
b820b9d530 Update pytest-qt from 2.2.1 to 2.3.0 2017-11-27 16:02:22 +01:00
pyup-bot
5f30016901 Update hypothesis from 3.38.0 to 3.38.5 2017-11-27 16:02:21 +01:00
pyup-bot
54db781b97 Update hunter from 2.0.1 to 2.0.2 2017-11-27 16:02:20 +01:00
pyup-bot
5df2025745 Update cheroot from 5.9.1 to 5.10.0 2017-11-27 16:02:18 +01:00
pyup-bot
6c47b5d2d7 Update setuptools from 36.8.0 to 38.2.1 2017-11-27 16:02:17 +01:00
pyup-bot
a4b96c3443 Update check-manifest from 0.35 to 0.36 2017-11-27 16:02:15 +01:00
Jimmy
0381d74e9a Greasemonkey: privatise some utility functions 2017-11-27 20:10:38 +13:00
Florian Bruhin
0e80be2d30 Clear end2end test data again after initializing
If we don't do this, earlier tests can affect later ones when e.g. using "...
should not be logged", as we don't really wait until a test has been fully
finished.
2017-11-27 20:10:38 +13:00
Florian Bruhin
db353c4030 Connect the page signal for GreaseMonkey
Looks like we don't get the mainFrame's loadFinished signal properly.
2017-11-27 20:10:38 +13:00
Florian Bruhin
6933bc05b4 Add some debug logging for GreaseMonkey with QtWebKit 2017-11-27 20:10:38 +13:00
Jimmy
df624944f9 Greasemonkey: webkit: injected all scripts on loadFinished.
The signal we were using to inject greasemonkey scripts registered to
run at document-start (javaScriptWindowObjectCleared) was unreliable to
non-existant. The initialLayoutCompleted signal is a bit of an odd duck
too I suppose. Anyway, we don't anticipate any scripts would break from
being injected when the page is finished loaded that wouldn't already
have been flaky due to the complexities of the modern web. If there is
an issue hopefully someone raises an issue and we can look into it.
2017-11-27 20:10:38 +13:00
Jimmy
8a5b42ffbd Greasemonkey: es6ify the greasemonkey wrapper js.
Because backwards compatibility sucks I guess.
2017-11-27 20:10:38 +13:00
Jimmy
92b48e77c7 Greasemonkey: add unit tests for GreasemonkeyManager 2017-11-27 20:10:38 +13:00
Jimmy
dd59f8d724 Greasemonkey: add more end2end tests
Test document-end and noframes. Because coverage.py told me to.
Hopefully this doesn't slow the test run down too much, particularly the
"should not be logged" bit.

I'm just reusing and existing test html page that used an iframe because
I'm lazy.
2017-11-27 20:10:38 +13:00
Jimmy
361a1ed6e4 Greasemonkey: change PROPS_REGEX to handle non-value keys.
We weren't actually picking up the @noframes greasemonkey directive
because of this. I haven't tested this very extensively but it seems to
work for making the property value optional.
2017-11-27 19:27:31 +13:00
Jimmy
9aeb5775c1 greasemonkey: run scripts on subframes on webkit
Use the `QWebPage.frameCreated` signal to get notifications of subframes
and connect the javascript injection triggering signals on those frames
too.

I had to add a `url = url() or requestedUrl()` bit in there because the
inject_userjs method was getting called to early or something when
frame.url() wasn't set or was set to the previous page so we were
passing the wrong url to greasemonkey.scripts_for().

I ran into a bizarre (I maybe it is completely obvious and I just don't
see it) issue where the signals attached to the main frame that were
connected to a partial function with the main frame as an argument were
not getting emitted, or at least those partial functions were not being
called. I worked around it by using None to mean defaulting to the main
frame in a couple of places.
2017-11-27 19:27:31 +13:00
Jimmy
4c3461038d Greasemonkey: add minimal end-to-end test.
Just runs a greasemonkey script on a test page and uses console.log to
ensure it is running.

Tests @include, and basic happy path greasemonkey.py operation (loading
and parsing script, scrip_for on webkit), only testing document-start
injecting point but that is the troublsome one at this point.

Tested on py35 debian unstable (oldwebkit and qtwebengine5.9) debian
stable qtwebengine5.7.

Note the extra :reload call for qt5.7 because document-start scripts
don't seem to run on the first page load with the current insertion
point. I need to look into this more to look at ways of fixing this.
2017-11-27 19:27:31 +13:00
Jimmy
7c497427ce Greasemonkey: various javascript fixups to GM wrapper template.
Thanks to @sandrosc. A few breaking changes fixed (default method to
GM_xhr not working, GM_listvalues not cleaning up output, GM_setvalue
param checking logic wrong) and a few hygenic changes made.
2017-11-27 19:27:31 +13:00
Jimmy
c0832eb04b Greasemonkey: support @nosubframes.
And run on frames by default. At least on webengine. There is probably
some api to enumerate frames on a webkit page.

Not tested.
2017-11-27 19:27:31 +13:00
Jimmy
fb019b2dab Address second round line comments.
Add qute version to GM_info object in GM wrapper.
Support using the greasemonkey @namespace metadata for its intended
purpose of avoiding name collisions.
Get a nice utf8 encoded string from a QUrl more better.
2017-11-27 19:27:31 +13:00
Jimmy
efde31aa57 Greasemonkey: Support QTWebEngine versions < 5.8
QTWebEngine 5.8 added support for parsing greasemonkey metadata blocks
and scripts added to the QWebEngineScriptCollection of a page or its
profile and then deciding what urls to run those scripts on and at what
point in the load process to run them. For earlier versions we must do
that work ourselves. But with the additional handicap of the less rich
qtwebengine api.

We have acceptNavigationRequest, loadStarted, loadProgress,
loadFinished, urlChanged to choose from regarding points at which to
register scripts for the current page.

Adding scripts on acceptNavigation loadStarted and loadFinished causes
scripts to run too early or too late (eg on the pages being navigated
from/to) and not run on the desired page at the time they are inserted.
We could maybe do some more sophisticated stuff with loadProgress but it
didn't have any better behaviour in the brief testing I gave it.
Registering scripts on the urlChanged event seems to work fine. Even if
it seems like there could be problems with the signal firing too often,
due to not necessarily being tied to the page load progress, that
doesn't seem to have an effect in practice. The event is fired when, for
example, the url fragment changes and even if we add a new script to the
collection (or remove an existing one) it doesn't have an effect on what
is running on the page.

I suspect all of those timing issues is due to the signals being
forwarded fairly directly from the underlying chomium/blink code but the
webengine script stuff only being pushed back to the implementation on
certain events.

Anyway, using urlChanged seems to work fine due to some quirk(s) of the
implementation. That might change with later development but this
codepath is only ever going to be used for version 5.7.

There are other potential optimizations like not removing and then
re-adding scripts for the current page. But they probably wouldn't do
anything anyway, or at least anything that you would expect.
2017-11-27 19:27:31 +13:00
Jimmy
209e43e0ba Greasemonkey: Match against percent encoded urls only.
This change requires urls specified in @include, @exclude and @matches
directives in metadata blocks to be in the same form that
QUrl.toEncoded() returns. That is a punycoded domain and percent encoded
path and query. This seems to be what Tampermonkey on chrome expects to.

Also changes the scripts_for() function to take a QUrl arg so the caller
doesn't need to worry about encodings.
2017-11-27 19:27:31 +13:00
Jimmy
d318178567 Greasemonkey: Fix metadata block regex.
This regex was broken since the original PR and subsequent code seemed to be
working around it. Before re.split was returning [everything up to
/UserScript, everything else], now it returns [before UserScript, metadata,
after /UserScript], which is good.

Also I added the check for the UserScript line starting at column 0 as per
spec.
2017-11-27 19:27:31 +13:00
Jimmy
5e49e7eef2 Greasemonkey: Throw Errors if GM_ function args wrong type.
These argument type restrictions are mentioned on the greasespot pages for
these value storage functions. We could call JSON.dumps() instead but better
to push that onto the caller so we don't have to try handle deserialization.

Also removes the check for localstorage because everyone has supported that
for years.
2017-11-27 19:27:31 +13:00
Jimmy
d93c583c0d Greasemonkey: Escape jinja variables for JS strings. 2017-11-27 19:27:31 +13:00
Jimmy
a7f41b4564 Greasemonkey: ensure only GM scripts are cleaned up on reload.
WebEngine only. Previously we were just removing every script from the
main world. But some other scripts might got here in the future so new
we are overriding the name field to add a GM- prefix so hopefully we
only remove greasemonkey scripts before adding new ones.
2017-11-27 19:27:31 +13:00
Jimmy
fd5d44182b Greasemonkey: move GM_* template into seperate file.
Also ported it to jinja rather than str.format().

Also ran the js through jslint and fixed up a few very minor things.
2017-11-27 19:27:31 +13:00
Jimmy
c1b912f567 Greasemonkey: move inject_userscripts into webenginesettings 2017-11-27 19:27:31 +13:00
Jimmy
edf737ff7d Greasemonkey: move scripts for a domain into data class.
Also makes scripts that don't include a greasemonkey metadata block
match any url. QWebEngine already has that behaviour.
2017-11-27 19:27:31 +13:00
Jimmy
41035cb5ca Greasemonkey: restrict page schemes that scripts can run on
Scripts shouldn't run on qute://settings or source:// etc.

Whitelist from:
https://wiki.greasespot.net/Include_and_exclude_rules
2017-11-27 19:27:31 +13:00
Jimmy
799730f686 Remove GM_ and userscript variables from global scope. 2017-11-27 19:27:31 +13:00
Jimmy
325c595b89 Greasemonkey: Don't strip gm metadata from scripts when loading.
Since we just pass them to webenginescriptcollection on that backend and
that wants to parse it itself to figure out injection point etc.
2017-11-27 19:27:31 +13:00
Jimmy
f26377351c Greasemonkey: Add greasemonkey hooks for webengine.
For qtwebengine 5.8+ only. This is because as of 5.8 some greasemonkey
script support is in upstream. That is, qtwebenginescript(collection)
parses the greasemonkey metadata block and uses @include/match/exclude
to decide what sites to inject a script onto and @run-at to decide when
to inject it, which saves us the trouble. Notes on doing this in <5.8
are below.

Scripts are currently injected into the main "world", that is the same
world as the javascript from the page. This is good because it means
userscripts can modify more stuff on the page but it would be nice if we
could have more isolation without sacrificing functionality. I'm still
looking into why my more feature-full scripts are not having any effect
on the page while running in a separate world.

Userscripts are added to both the default and private profile because I
that if people have scripts installed they want them to run in private mode
too.

We are grabbing the scripts from the greasemonkey module, as opposed to
reading them directly from disk, because the module adds some GM_* functions
that the scripts may expect, and because that is used for webkit anyway.

I have code to support qtwebengine <5.8 but didn't because I am not
happy with the timing of some of the signals that we are provided
regarding page load state, and the actual load state. While the
difference between document-end and document-idle isn't so bad,
injecting document-start scripts when a urlChanged event is emitted
results in the script being injected into the environment for the page
being navigated away from. Anyway, if anyone wants this for earlier
webengines I can oblige them.
2017-11-27 19:27:31 +13:00
Jimmy
be9f8bd0de Greasemonkey: Lift greasemonkey init app.py
To prepare for multiple-backend support.
2017-11-27 19:27:31 +13:00
Jimmy
25f626a436 Greasemonkey: Add run-at document-idle.
Supposed to be after all the assets have finished loading and in page js
has run. Not that we can garuntee that last bit. If a script misbehaves
because a precondition isn't yet met I suggest adding a defer method to
the script that adds a timer until the precondition is met.

Also changed the map/filter calls to use list comprehensions to keep
pylint happy. Even if it does look uglier.
2017-11-27 19:27:31 +13:00
Jimmy
13728387d7 Greasemonkey: Fix crash on undefined metadata. 2017-11-27 19:27:31 +13:00
Jimmy
ecdde7663f Add greasemonkey-reload command.
Also add a signal to emit when scripts are reloaded. Had to make
GreasemonkeyManager inherit from QObject to get signals to work.
2017-11-27 19:27:31 +13:00
Andor Uhlár
568d60753e Add greasemonkey compatible userscript module.
WebKit backend only for now. Loads all .js files from a directory,
specified in the greasemonkey-directory key in the storage section,
defaulting to data/greasemonkey, and wraps them in a minimal environment
providing some GM_* functions. Makes those scripts available via the
"greasemonkey" registered object in objreg and injects scripts at appropriate
times in a page load base on @run-at directives.
2017-11-27 19:27:31 +13:00
Florian Bruhin
75a8938e83 Add flake8-bugbear 2017-11-26 21:50:12 +01:00
Florian Bruhin
248a12a8b9 Add flake8-comprehensions 2017-11-26 21:42:50 +01:00
Florian Bruhin
1981239478 Add flake8-builtins 2017-11-26 21:22:33 +01:00
Florian Bruhin
5490f70b25 Remove flake8-pep3101
It seems to trigger when using modulo on ints as well, which is kind of
annoying.

See #3320
2017-11-26 20:30:42 +01:00
Florian Bruhin
b5dd647678 Upgrade pydocstyle/flake8-docstrings
See #3320
2017-11-26 20:30:32 +01:00
Florian Bruhin
7520a365eb Update comments 2017-11-26 19:43:49 +01:00
Florian Bruhin
0f3cff60fa Merge remote-tracking branch 'origin/pr/3335' 2017-11-26 19:42:54 +01:00
Florian Bruhin
95f34d755f Update changelog 2017-11-26 19:35:58 +01:00
Florian Bruhin
38f8cacd2b Merge remote-tracking branch 'origin/pr/3336' 2017-11-26 19:35:26 +01:00
Florian Bruhin
4c1f6158bd Update changelog
[ci skip]
2017-11-26 17:32:29 +01:00
Florian Bruhin
67253726fa Handle empty messages in qt_message_handler
I can't reproduce this, but someone on KDE reported always getting a crash (as
msg.splitlines()[0] gives an IndexError) when trying to select a file with
Qt 5.9.3.
2017-11-26 17:31:07 +01:00
Ryan Roden-Corrent
54fffc8264 Resolve crash when editor tab is closed.
If an editor is open on a form in a tab and that tab is closed, rewire
the callback to print a warning. Previously, the callback would access a
deleted C++ object and cause a crash.
Resolves #2758.
2017-11-26 07:50:49 -05:00
Panagiotis Ktistakis
2bb8d404d2 Adjust :bind completion tests 2017-11-26 14:07:41 +02:00
Panagiotis Ktistakis
e05dabefdf Show default keybinding in :bind completion 2017-11-26 13:34:18 +02:00
Ryan Farley
650b0051e6 remove useless ignores 2017-11-26 01:59:21 -06:00
Ryan Farley
5ed8019115 update flake8 and flake8-deprecated
Updated requirements and adjusted the configuration in `.flake8`; other
files have been modified where the lack of per-file auto-ignore caused
problems, where putty's `# flake8: disable=` syntax could be replaced
with a simpler `noqa`, or where pylint directives already suppressed the
same error.
2017-11-26 00:16:14 -06:00
狼耳
e8db59a9ef Use socat exit status to determine if the socket is usable
Instead of checking, if *any* qutebrowser process is running (which may or may not have an IPC socket where we expect it), simply launch a new instance  *if socat fails*. 
Which it does, if: 
* the socket file doesn't exist (qutebrowser simply not running), or
* the socket isn't connectable (qutebrowser crashed, left orphaned socket)
 
Also put new instances into background, so the script behaves a bit more consistently. (Else it *sometimes* blocks and *sometimes doesn't*, when run.)
2017-11-25 11:09:57 +01:00
Jay Kamat
c9af36909f Add tests for hint scattering 2017-11-24 13:21:21 -05:00
mhm@mhm.com
9df149fe8f urlencode fix 2017-11-24 17:15:26 +01:00
Florian Bruhin
03a9cbdfb4 Break long lines
(cherry picked from commit 18a45bbd5b)
2017-11-24 16:03:34 +01:00
狼耳
765a22189c check if qutebrowser process is running
Sometimes when qutebrowser crashes, it leaves the IPC socket file behind. In those cases this script still tried to use it, failed, and didn't open your URL at all.
2017-11-24 14:52:33 +01:00
Florian Bruhin
06fc52321e Ignore new Qt 5.9.3 error message 2017-11-24 14:24:15 +01:00
Florian Bruhin
15c7ede916 Update to PyQt 5.9.2 2017-11-24 14:24:15 +01:00
Lucas Hoffmann
6cc78aeaee Register qutebrowser as a handler for qute:// links
These links mostly occur within qutebrowser's documentation.  But the
are also written to the auto generated config file.  Clicking them in
any application that consults the desktop database (or uses xdg-open)
will thus open them in qutebrowser correctly.
2017-11-24 13:32:13 +01:00
Artur Shaikhullin
72040a3bbb Position caret on top element 2017-11-24 17:32:23 +06:00
Florian Bruhin
0afd6b23c9 Add the option name to the backend error message 2017-11-24 09:25:45 +01:00
Florian Bruhin
28d7c5e204 Fix lint 2017-11-24 07:25:10 +01:00
Jay Kamat
739cfc03ba Fix undercounting short hints 2017-11-23 23:14:21 -05:00
Artur Shaikhullin
8a64ce19c3 Fetch selection for userscripts 2017-11-23 20:18:43 +06:00
Ryan Roden-Corrent
8eab402820 Abort :edit-command on invalid input.
Show an error message if the user edits the command such that it is
missing a start character (:, /, or ?). Previously, this would cause the
browser to crash.

Resolves #3326.
2017-11-23 08:15:27 -05:00
Florian Bruhin
b31360b6e3 Fix line break 2017-11-22 17:19:21 +01:00
Florian Bruhin
750d2c490f Fix :completion-item-focus --history with / or ?
If we have no completion (like when searching), we can just always go through
history with up/down.
2017-11-22 15:34:48 +01:00
Artur Shaikhullin
e7a66d92a8 Selection implentation 2017-11-22 19:56:05 +06:00
Florian Bruhin
5d8c9577a7 Improve hypothesis example generation for configtypes.Dict 2017-11-22 11:53:49 +01:00
Florian Bruhin
72d466d236 Break long lines 2017-11-22 11:34:10 +01:00
Florian Bruhin
487951cd31 Fix joining :jseval path 2017-11-22 10:57:48 +01:00
Florian Bruhin
cbf5fc01fa Avoid more about:blank loads 2017-11-22 10:15:18 +01:00
Florian Bruhin
221b81ae90 Fix typo in changelog 2017-11-22 09:37:17 +01:00
Florian Bruhin
12f4940ef3 Make :jseval use a fixed path with relative paths 2017-11-22 09:37:17 +01:00
Florian Bruhin
3b3acba34e Edit description of tabs.persist_mode_on_change 2017-11-22 09:11:17 +01:00
Florian Bruhin
2581be051f Always leave hint/caret mode when switching tabs
See #3323
2017-11-22 08:53:01 +01:00
Florian Bruhin
401a37bf4b Stabilize :spawn with userscript tests 2017-11-22 08:43:47 +01:00
Florian Bruhin
e5cabb6d23 Match QtWebKit error message for qute://help/img test 2017-11-22 08:40:20 +01:00
Florian Bruhin
fd93e7ba6c Update docs 2017-11-22 08:02:38 +01:00
Florian Bruhin
94b2a41ed7 Merge remote-tracking branch 'origin/pr/3323' 2017-11-22 08:00:57 +01:00
Florian Bruhin
aa417019ae Try stabilizing loading about:blank in end2end tests 2017-11-22 07:59:22 +01:00
Florian Bruhin
8acfe501fe Revert "Stabilize cleaning up open tabs"
We're going to fix this in a more generic way.

This reverts commit 8440303d82.
2017-11-22 07:56:31 +01:00
Florian Bruhin
c4291a8ed5 Update GitHub contributing docs 2017-11-22 07:52:03 +01:00
mhm@mhm.com
e2d5a443cc lazy sessions 2017-11-21 23:57:06 +01:00
Vladimir Shulyak
358c888760 Fix long line 2017-11-21 22:35:19 +00:00
Vladimir Shulyak
7532db83c4 Add option to persist current mode on tab change 2017-11-21 18:57:41 +00:00
Florian Bruhin
b684e50cdf Stabilize view-source test 2017-11-21 18:14:17 +01:00
Florian Bruhin
9744a3d0bc Skip test_webenginesettings without QtWebEngine 2017-11-21 17:58:32 +01:00
Artur Shaikhullin
8aca37e5d5 Implement all caret browsing methods 2017-11-21 19:56:00 +06:00
Florian Bruhin
8440303d82 Stabilize cleaning up open tabs
For some reason, about:blank isn't properly loaded sometimes. But this should
always work.
2017-11-21 14:53:31 +01:00
Florian Bruhin
2f12233cb7 Update changelog 2017-11-21 14:10:48 +01:00
Florian Bruhin
6c9f496edf Add a test for setting content.cache.size to a big value 2017-11-21 14:09:38 +01:00
Florian Bruhin
a451e8ac9d Add a cache_tmpdir fixture 2017-11-21 14:09:30 +01:00
Florian Bruhin
c9d42c8bea Enable strict overflow checking in tests 2017-11-21 14:09:20 +01:00
Florian Bruhin
203b6c354f Fix content.cache.size overflow with QtWebEngine
While 64-bit values are allowed with QtWebKit/QNetworkDiskCache, QtWebEngine
only allows 32-bit values here. With the updated sip's strict overflow checking,
that means we get an exception when setting a too big value.
2017-11-21 14:07:49 +01:00
Florian Bruhin
75555fc244 Fix warning regex 2017-11-21 13:21:50 +01:00
Florian Bruhin
cff557d2fc Try to stabilize command test, take 2 2017-11-21 13:19:11 +01:00
Florian Bruhin
56d1c5c7dd Stabilize command history test 2017-11-21 11:31:22 +01:00
Florian Bruhin
54af872825 Add missing comma 2017-11-21 10:45:49 +01:00
Florian Bruhin
dc00bc1774 Add an initial Makefile 2017-11-21 10:35:11 +01:00
Florian Bruhin
273747624f Update tox environment list in contributing docs 2017-11-21 09:24:43 +01:00
Florian Bruhin
c3128494a1 Create CODE_OF_CONDUCT.md 2017-11-21 09:19:06 +01:00
mhm@mhm.com
607cd9ba6e indent adjusted 2017-11-21 01:19:04 +01:00
mhm@mhm.com
aa40842848 lazy sessions, docstring formatted, settings renamed, javascript notice changed, insert method changed 2017-11-21 00:38:51 +01:00
Florian Bruhin
d90d626ac4 Merge remote-tracking branch 'origin/pr/3316' 2017-11-20 21:17:29 +01:00
Florian Bruhin
25be4d4383 Merge remote-tracking branch 'origin/pr/3318' 2017-11-20 21:16:57 +01:00
Florian Bruhin
203233c894 Track the view correctly in the webengineview fixture
This makes sure the view is closed after the test (fixing test_none on AppVeyor)
and also makes sure we have a QApplication.
2017-11-20 20:47:40 +01:00
Florian Bruhin
a5d9661d73 Simplify is_ignored_lowlevel_message 2017-11-20 19:29:31 +01:00
Ryan Roden-Corrent
5495380580 Exit command mode after :edit-command --run.
Resolves #3317, where the command prompt was left open and populated
with text after running the command.
2017-11-20 11:46:26 -05:00
pyup-bot
feb02769ad Update pytest from 3.2.3 to 3.2.5 2017-11-20 16:02:20 +01:00
pyup-bot
8dcd5708e3 Update py from 1.4.34 to 1.5.2 2017-11-20 16:02:19 +01:00
pyup-bot
934fb5f7d5 Update py from 1.4.34 to 1.5.2 2017-11-20 16:02:17 +01:00
pyup-bot
b3d757d034 Update hypothesis from 3.37.0 to 3.38.0 2017-11-20 16:02:16 +01:00
pyup-bot
8f0332bcf6 Update cheroot from 5.8.3 to 5.9.1 2017-11-20 16:02:14 +01:00
pyup-bot
1cc6e7190e Update setuptools from 36.7.1 to 36.8.0 2017-11-20 16:02:13 +01:00
Florian Bruhin
abb5c9f638 Ignore Qt 5.7 OpenSSL logging message 2017-11-20 13:58:37 +01:00
Florian Bruhin
3b680d0bff Pass --disable-seccomp-filter-sandbox for tests with Qt 5.7.1
This is a stop-gap so I'm able to run end2end tests at least.
See #3163.

For unit tests, we need https://github.com/pytest-dev/pytest-qt/pull/193 first.
2017-11-20 13:54:52 +01:00
Artur Shaikhullin
82b1bd10ec Add some movement caret actions 2017-11-20 17:49:42 +06:00
Florian Bruhin
b6bfe7c171 Update docs 2017-11-19 21:11:10 +01:00
Florian Bruhin
8555b86e3b Add copyright notice for pyeval_file.py 2017-11-19 21:09:48 +01:00
Florian Bruhin
a2c549b954 Merge remote-tracking branch 'origin/pr/3313' 2017-11-19 21:09:19 +01:00
Florian Bruhin
87b174b418 Simplify :completion-item-focus 2017-11-19 21:07:33 +01:00
Florian Bruhin
112800bab9 Fix backslashes in string 2017-11-19 21:04:57 +01:00
Florian Bruhin
62f37df573 Make cursor keys go through completion if a text was entered
This hopefully helps with people who try to use arrow keys for the completion,
while still making the command history somewhat discoverable.
2017-11-19 20:35:16 +01:00
akhilkpdasan
740d629b36 Update utilcmds.py 2017-11-20 00:56:09 +05:30
Florian Bruhin
c14135a6ce Add :edit-command to docs 2017-11-19 19:57:44 +01:00
Akhil kp
21e731ebeb fixed build errors(typing errors) 2017-11-19 23:49:11 +05:30
akhilkpdasan
9a58fe229c fixed spelling error 2017-11-19 19:32:24 +05:30
akhilkpdasan
4644642c38 fixed test for pyeval --file 2017-11-19 19:10:36 +05:30
akhilkpdasan
ba6d90aa7a fixed docmentation for pyeval 2017-11-19 19:08:52 +05:30
Florian Bruhin
6a90cebe85 Get rid of backslash 2017-11-19 14:29:22 +01:00
Florian Bruhin
28d3771005 Update changelog 2017-11-19 14:25:47 +01:00
Florian Bruhin
5e20aa668a Merge remote-tracking branch 'origin/pr/3262' 2017-11-19 14:24:48 +01:00
Florian Bruhin
91c909cb80 Merge remote-tracking branch 'origin/pr/3212' 2017-11-19 14:24:40 +01:00
Florian Bruhin
8cd9cdea84 Update changelog 2017-11-19 14:11:20 +01:00
Florian Bruhin
8c7bf12b88 Merge remote-tracking branch 'origin/pr/3306' 2017-11-19 14:08:58 +01:00
Florian Bruhin
c2973ebca3 Merge remote-tracking branch 'origin/pr/3305' 2017-11-19 14:07:26 +01:00
Florian Bruhin
1a1f0fc1ee Update changelog 2017-11-19 14:06:11 +01:00
Florian Bruhin
2b063f577e Handle OSError in :config-write-py 2017-11-19 14:06:11 +01:00
Florian Bruhin
8fb03208e7 Improve parsing of fatal stacktraces
We now also recognize "Windows fatal exception: ..." message and refuse to
send empty Windows access violation messages.
2017-11-19 14:06:11 +01:00
Florian Bruhin
4a37e40fcc Merge pull request #3311 from novel/doc-freebsd-port
Document installation using FreeBSD port
2017-11-19 14:05:00 +01:00
Akhil kp
c5eab53a87 Added --file for :debug-pyeval 2017-11-19 18:20:58 +05:30
Roman Bogorodskiy
51ce534638 Document installation using FreeBSD port 2017-11-19 14:30:32 +04:00
Ryan Roden-Corrent
d145b304d0 Remove maxsplit from edit_command.
This was a copy-paste typo, no need for maxsplit as this command takes
no positional args.
2017-11-18 20:41:23 -05:00
mhm@mhm.com
13dc24f6ca debug code removed 2017-11-18 14:31:55 +01:00
mhm@mhm.com
cf8130bd22 lazy session, fix: active entry is not the end of the history 2017-11-18 14:28:44 +01:00
mhm@mhm.com
2debeafe1b lazy sessions, dont save qute://back 2017-11-18 13:51:30 +01:00
mhm@mhm.com
1a33c88c96 lazy sessions, dont save qute://back 2017-11-18 13:47:57 +01:00
mhm@mhm.com
c150c5481a lazy sessions, dont save qute://back 2017-11-18 13:46:50 +01:00
mhm@mhm.com
c4bb134313 lazy sessions, improved version 2017-11-18 11:05:54 +01:00
Jay Kamat
6338810396 Increase timeouts for javascript tests 2017-11-17 21:42:24 -05:00
mhm@mhm.com
51dea053f4 lazy sessions 2017-11-18 01:00:16 +01:00
mhm@mhm.com
ade7004f8f lazy sessions 2017-11-18 00:48:31 +01:00
mhm@mhm.com
95f8c07d7f lazy sessions 2017-11-18 00:31:53 +01:00
Jay Kamat
6c241f96ed Add test for appendChild #2723
Does some of #3295
2017-11-17 17:52:35 -05:00
cryzed
d8887f12c0 Deduplicate documentation 2017-11-17 21:40:08 +01:00
Ryan Roden-Corrent
0f93d53210 Implement :edit-command.
:edit-command opens the current command line in an editor, and updates
the command line if the editor exits successfully. If --run is passed,
the command is executed when the editor exits sucessfully.

Resolves #2453.
2017-11-17 11:16:42 -05:00
Josefson Fraga
3131d3d3bc Flake8 warnings pointed by travis. 2017-11-17 11:48:34 -03:00
cryzed
274c92a64b Add documentation additionally to the help page of qute-pass (complaint from the Arch wiki) 2017-11-17 12:42:25 +01:00
Josefson Fraga
96599b9684 revisions set by The Compiler 2017-11-17 02:38:56 -03:00
Artur Shaikhullin
b184d2f94d dirty initial port of chrome caretbrowser extension 2017-11-16 19:25:15 +06:00
Florian Bruhin
3a012ca1e3 Update changelog 2017-11-16 11:21:00 +01:00
Florian Bruhin
b26f2290bc Merge remote-tracking branch 'origin/pr/3097' 2017-11-16 11:14:59 +01:00
Florian Bruhin
e856639db7 Update changelog 2017-11-16 10:19:47 +01:00
Florian Bruhin
b3085f5d60 Merge remote-tracking branch 'origin/pr/3291' 2017-11-16 10:17:02 +01:00
Florian Bruhin
e3a3edaf9a Update list of alternatives
[ci skip]
2017-11-16 10:05:26 +01:00
Florian Bruhin
47480d07f0 Make the docs for a tox wrapper script clearer
[ci skip]
2017-11-16 08:52:28 +01:00
Florian Bruhin
625a2c3060 Merge remote-tracking branch 'origin/pr/3293' 2017-11-16 08:03:02 +01:00
Ryan Farley
e2169d2d92 importer: fix style issues 2017-11-15 20:00:14 -06:00
Florian Bruhin
8104869ab6 Update docs 2017-11-15 13:04:11 +01:00
dwagle
233cea4b62 discarded unnecessary comment and adjusted some code to make pylint happy, also made adjustments to pytest scenarios 2017-11-15 15:48:21 +05:45
Florian Bruhin
dbefaccf06 Set python_requires in setup.py 2017-11-15 09:47:45 +01:00
Panagiotis K
e4be834b39 Platform-agnostic test. 2017-11-15 09:51:05 +02:00
Jay Kamat
92a6e61b52 Use importorskip to skip stylesheet tests on webkit only systems 2017-11-15 02:05:34 -05:00
Florian Bruhin
ccdd1e5f06 Update changelog 2017-11-15 07:33:03 +01:00
Florian Bruhin
ea71f0e318 Merge remote-tracking branch 'origin/pr/3285' 2017-11-15 07:32:04 +01:00
Florian Bruhin
404f9ea1d0 Merge remote-tracking branch 'origin/pr/3290' 2017-11-15 07:31:10 +01:00
Ryan Farley
2b6763ad13 importer: tests
Added tests for Netscape and Mozilla formats.
2017-11-14 19:23:34 -06:00
dwagle
b3b768f4a8 normalize url path and strip trailing slashes when doing gu/gU, normalize every qute://* urls and raise OSError when a url redirects to a directory in qute://help/ pages 2017-11-14 21:23:40 +05:45
Florian Bruhin
e72e8b8556 Revert "Hide quickmark/bookmark completion if empty."
This reverts commit 23716f1212.

See #3016
Fixes #3288
Reopens #960
2017-11-14 13:29:58 +01:00
Florian Bruhin
9febcc2e76 Use https:// links for qutebrowser.org
Fixes #3289
2017-11-14 10:43:05 +01:00
Florian Bruhin
62f35ee064 Fix lint 2017-11-14 09:05:28 +01:00
Dasith Gunawardhana
ea70a0dea1 changed setting name and reverted non-issue fix 2017-11-14 01:41:15 -05:00
Florian Bruhin
111cc7093f Update changelog 2017-11-14 06:20:09 +01:00
Florian Bruhin
1203be2a44 Remove unnecessary str() call 2017-11-14 06:19:42 +01:00
Jay Kamat
28572ce3b1 Fix stylesheet tests crashing when no QtWebEngine available 2017-11-14 00:00:53 -05:00
Dasith Gunawardhana
4419e59d46 prevent WM fullscreen from being unset when desktop_fullscreen is false 2017-11-13 23:25:10 -05:00
Jay Kamat
4845180689 Update version tests for uptime 2017-11-13 23:20:50 -05:00
Jay Kamat
ae48fa68a8 Add an uptime section to qute:version 2017-11-13 21:58:00 -05:00
Dasith Gunawardhana
36c8ca9790 added option to limit fullscreen to window only 2017-11-13 21:38:02 -05:00
Jay Kamat
5913552dfe Fix style issues in stylesheet tests 2017-11-13 19:57:11 -05:00
Florian Bruhin
408ceefad1 Merge branch 'none-position' 2017-11-13 20:42:22 +01:00
Florian Bruhin
3c9bd25f3d Merge remote-tracking branch 'origin/pr/3284' 2017-11-13 20:40:30 +01:00
Florian Bruhin
870c15a02c Merge remote-tracking branch 'origin/pr/3264' 2017-11-13 20:40:23 +01:00
Ryan Roden-Corrent
b72343d126 Yank selected text with completion-item-yank.
If text is highlighted in the status command bar, completion-item-yank
should yank that rather than the selected completion item.

Resolves #3281.
2017-11-13 13:25:18 -05:00
Jay Kamat
0f17e6633d Stop calling _register automatically for StyleSheetObservers 2017-11-13 12:04:31 -05:00
pyup-bot
ebe44e5f65 Update jinja2 from 2.9.6 to 2.10 2017-11-13 15:59:18 +01:00
pyup-bot
a3f9991ce2 Update hypothesis from 3.36.0 to 3.37.0 2017-11-13 15:59:16 +01:00
pyup-bot
8407d0a227 Update attrs from 17.2.0 to 17.3.0 2017-11-13 15:59:15 +01:00
pyup-bot
327613d02a Update attrs from 17.2.0 to 17.3.0 2017-11-13 15:59:13 +01:00
pyup-bot
ccc671b998 Update setuptools from 36.6.0 to 36.7.1 2017-11-13 15:59:12 +01:00
Florian Bruhin
b9f807011a Update changelog
[ci skip]
2017-11-13 13:11:05 +01:00
Florian Bruhin
df4a011d48 Put files into the config dir with :config-write-py and rel. paths 2017-11-13 10:58:51 +01:00
Florian Bruhin
5c43dca0da Improve error message for files which don't exist 2017-11-13 10:47:37 +01:00
Florian Bruhin
8057f5c281 Set __tracebackhide__ for _check_completions 2017-11-13 09:02:16 +01:00
Florian Bruhin
f6cc6677dd Remove hiding of commands
This was often confusing for people - let's instead just hide commands which are
not available in normal mode.
2017-11-13 09:02:16 +01:00
Florian Bruhin
009fa845f4 Update docs 2017-11-13 07:12:48 +01:00
Florian Bruhin
ec6017b3b2 Remove unneeded parens 2017-11-13 07:09:59 +01:00
Florian Bruhin
7f0ecaa89e Merge remote-tracking branch 'origin/pr/3266' 2017-11-13 07:09:49 +01:00
Florian Bruhin
fc8f2090f0 Merge remote-tracking branch 'origin/pr/3271' 2017-11-13 07:09:29 +01:00
Florian Bruhin
ccb564de36 Merge remote-tracking branch 'origin/pr/3279' 2017-11-13 07:08:53 +01:00
Ryan Roden-Corrent
23716f1212 Hide quickmark/bookmark completion if empty.
If there are no quickmarks/bookmarks, hide the entire category in url
completion. Note that this only hides the category if
quickmarks/bookmarks is empty to begin with. An empty category is still
shown if the completion pattern filters out all items in that category.

See #960.
2017-11-12 22:28:49 -05:00
Florian Bruhin
f6e6f9d27b Make qutebrowser aware of settings requiring a restart
See #3270
2017-11-12 17:17:19 +01:00
Jay Kamat
c1fcabe846 Remove default config-cycle bindings
Many people accidentally hit 'x{x,t,b}', hiding their statusbar by mistake
2017-11-11 16:16:26 -05:00
Jay Kamat
f242fc5cd7 Add setting to avoid shrinking pinned tabs 2017-11-11 11:33:33 -05:00
Jay Kamat
e00a072d15 Fix garbage collection of StyleSheetObserver objects 2017-11-10 23:25:46 -05:00
Jay Kamat
324c537a3d Refactor webkit and webengine js testers to have a common subclass 2017-11-10 13:00:44 -05:00
Jay Kamat
83e28a70c5 Fix error message printing for webengine js tests 2017-11-10 12:34:23 -05:00
Jay Kamat
d39dda38ce Refactor CallbackChecker into test utils 2017-11-10 12:27:00 -05:00
Jay Kamat
155ee198cd Update stylesheet tests for updates in stylesheet.js 2017-11-10 12:19:49 -05:00
Jay Kamat
5ac8e5ad3e Clean up stylesheet tests 2017-11-10 12:19:35 -05:00
Florian Bruhin
c47f0402ab Fix lint 2017-11-10 13:14:51 +01:00
Florian Bruhin
456c854f06 Improve documentation for :hint --rapid 2017-11-10 10:23:16 +01:00
Florian Bruhin
d19d896881 Update changelog 2017-11-10 09:42:27 +01:00
Florian Bruhin
8df759ecad Merge remote-tracking branch 'origin/pr/3259' 2017-11-10 09:42:05 +01:00
Florian Bruhin
fa456b0c6e Update changelog 2017-11-10 09:16:06 +01:00
Florian Bruhin
9bb3f8d677 Regenerate docs 2017-11-10 09:12:24 +01:00
Florian Bruhin
74af52a0c0 Merge remote-tracking branch 'origin/pr/3261' 2017-11-10 09:05:58 +01:00
Florian Bruhin
78f4abf5a1 Merge pull request #3257 from ryan-farley/import-chrome
importer: Chrome support
2017-11-10 09:02:09 +01:00
Jay Kamat
2f9a857a27 Add test for styling error pages 2017-11-09 14:44:33 -05:00
Jay Kamat
04b66e1a0a Add a test for svg files 2017-11-09 14:44:33 -05:00
Jay Kamat
03eae9140e Implement proper loading of stylesheet.js 2017-11-09 14:44:33 -05:00
Jay Kamat
9a1d10ca11 Add tests which override existing css 2017-11-09 14:44:33 -05:00
Jay Kamat
e7fdff5632 Implement basic stylesheet tests 2017-11-09 14:44:32 -05:00
Jay Kamat
2b5e8daba0 Implement qtwebengine version of JSTester 2017-11-09 14:44:32 -05:00
Ulrik de Muelenaere
b37517e55f Fix error in stylesheet.js on older QtWebEngine 2017-11-09 19:28:36 +02:00
Ryan Farley
b5bf114ad4 importer: add chrome profile tests 2017-11-09 02:39:43 -06:00
dkanada
2f7a705015 forgot to update the settings page 2017-11-08 15:29:35 -07:00
dkanada
6ecd429d8f group indicator preferences 2017-11-08 15:27:16 -07:00
dkanada
b8b49637e2 replace changes to desc 2017-11-08 14:46:00 -07:00
dkanada
785bf24652 change the code for the renamed preferences 2017-11-08 14:42:09 -07:00
Ryan Farley
5688fc9910 importer: test unsupported opensearch separate 2017-11-08 15:13:16 -06:00
Ryan Farley
2b7210f6d1 importer: trailing commas 2017-11-08 15:11:07 -06:00
Ryan Farley
8a695648d3 :%s/Qutebrowser/qutebrowser/g 2017-11-08 15:08:20 -06:00
Panagiotis K
59cebae28e Remove redundant import. 2017-11-08 18:23:51 +02:00
Florian Bruhin
7cc3fb4a4e Update FAQ entry for WebKitGTK projects
[ci skip]
2017-11-08 16:44:46 +01:00
cryzed
222c51aa6e Ignore additional Qt error messages 2017-11-08 16:34:40 +01:00
Florian Bruhin
180fb0d65a Fix handling of caret position with Qt 5.10
With Chromium 61 in Qt 5.10, we get null when getting .selectionStart on a
non-text element, like changed in the WhatWG HTML standard:
https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-textarea/input-selectionstart

See https://www.chromestatus.com/feature/5740194741354496

Older QtWebEngines and QtWebKit raise InvalidStateError instead.

This also changes the surrounding code and API so None is used to say "there's
no caret position available", which seems like a nicer API.
2017-11-08 16:27:26 +01:00
cryzed
6e719d1796 Fix issue #3251 2017-11-08 15:08:36 +01:00
Florian Bruhin
b9aa5df5ed Add unit tests for UnicodeEncodeError handling 2017-11-08 07:47:11 +01:00
Florian Bruhin
be08cee63c Make testsuite work with LC_ALL=C 2017-11-07 17:23:38 +01:00
Florian Bruhin
fdc43438ef Make tests for non-ASCII files work 2017-11-07 17:00:08 +01:00
Florian Bruhin
743dbbbcd6 Break long lines 2017-11-07 11:29:53 +01:00
Florian Bruhin
fdc9dfdf87 Merge remote-tracking branch 'origin/pr/3175' 2017-11-07 11:24:41 +01:00
Florian Bruhin
9f898611f3 Add missing path assignment 2017-11-07 11:24:00 +01:00
Florian Bruhin
32914cfaf8 Remove unneeded backslash 2017-11-07 11:17:18 +01:00
Florian Bruhin
3eafdc13d7 Merge remote-tracking branch 'origin/pr/3177' 2017-11-07 11:17:00 +01:00
Florian Bruhin
4a4948e601 Update docs 2017-11-07 10:00:25 +01:00
Florian Bruhin
73a6b6b730 Merge pull request #3252 from qutebrowser/pyup-scheduled-update-11-06-2017
Scheduled weekly dependency update for week 45
2017-11-07 08:19:18 +01:00
Florian Bruhin
0d68b8bb8f Update changelog 2017-11-07 07:47:17 +01:00
Florian Bruhin
4f0d8a84ee Merge remote-tracking branch 'origin/pr/3253' 2017-11-07 07:46:30 +01:00
Florian Bruhin
9f40b40942 Merge pull request #3255 from cincodenada/update-dict-docs
Update documentation to reflect new dictcli.py script
2017-11-07 07:30:38 +01:00
Joel Bradshaw
52be2dd665 Update documents to reflect new dictcli.py script 2017-11-06 22:21:07 -08:00
Florian Bruhin
8ddf843c64 Adjust flake8 pins
Looks like flake8-debugger 3.0.0 works with the old flake8 again, while
flake8-deprecated doesn't anymore (hah, the irony :D).
2017-11-07 06:34:04 +01:00
Florian Bruhin
bc8d767f6e Pin PyQt5 to 5.9 for now
A Linux wheel isn't available yet for 5.9.1, see:
https://www.riverbankcomputing.com/pipermail/pyqt/2017-November/039698.html
2017-11-07 06:32:32 +01:00
Florian Bruhin
aaed6549b3 Merge pull request #3254 from jgkamat/jay/pinned-tabs-mnemonics
Fix Qt Mnemonics affecting min tab width
2017-11-07 06:15:23 +01:00
Ryan Farley
f5d719dfd4 importer: Chrome support
This adds Chrome/Chromium support to the importer (which ought to be the
last of these). Bookmarks are read from JSON, while keywords/search
engines (the same thing here) are read from the Web Data sqlite3
database, and converted from OpenSearch format.

importer: add tests for opensearch
2017-11-06 21:19:57 -06:00
Jay Kamat
ecf6f4bca0 Fix Qt Mnemonics affecting min tab width
See #3245
2017-11-06 15:05:26 -05:00
Jan Verbeek
3e8c84c018 Make :undo re-open all tabs closed by :tab-only
This changes the undo stack from a list of UndoEntry objects to a list
of lists of UndoEntry objects, so groups of tabs can be added. Only
:tab-only does that, but it's exposed by TabbedBrowser.close_tab as a
keyword argument.
2017-11-06 19:32:10 +01:00
Florian Bruhin
b1f1248a05 Update changelog
[ci skip]
2017-11-06 16:27:17 +01:00
Florian Bruhin
0053b10e4d Merge remote-tracking branch 'origin/pr/3243' 2017-11-06 16:26:21 +01:00
pyup-bot
82fd26268b Update pytest-bdd from 2.18.2 to 2.19.0 2017-11-06 15:50:31 +01:00
pyup-bot
409f8327c2 Update hypothesis from 3.33.0 to 3.36.0 2017-11-06 15:50:30 +01:00
pyup-bot
360e0aaa67 Update sip from 4.19.3 to 4.19.5 2017-11-06 15:50:28 +01:00
pyup-bot
b42346b616 Update pyqt5 from 5.9 to 5.9.1 2017-11-06 15:50:27 +01:00
pyup-bot
0fdf0ff3b1 Update pefile from 2017.9.3 to 2017.11.5 2017-11-06 15:50:25 +01:00
pyup-bot
b759dbfc27 Update flake8-deprecated from 1.2.1 to 1.3 2017-11-06 15:50:23 +01:00
pyup-bot
b61a9c9512 Update flake8-debugger from 1.4.0 to 3.0.0 2017-11-06 15:50:22 +01:00
pyup-bot
0cc855019e Update coverage from 4.4.1 to 4.4.2 2017-11-06 15:50:20 +01:00
pyup-bot
cd27fb6af6 Update coverage from 4.4.1 to 4.4.2 2017-11-06 15:50:19 +01:00
pyup-bot
120fa41009 Update certifi from 2017.7.27.1 to 2017.11.5 2017-11-06 15:50:17 +01:00
pyup-bot
6a415aee4a Update certifi from 2017.7.27.1 to 2017.11.5 2017-11-06 15:50:16 +01:00
pyup-bot
1fbd209213 Update certifi from 2017.7.27.1 to 2017.11.5 2017-11-06 15:50:14 +01:00
Florian Bruhin
ad4caeac3a Regenerate docs 2017-11-06 13:52:42 +01:00
Florian Bruhin
e7da2142f3 Merge remote-tracking branch 'origin/pr/3249' 2017-11-06 13:52:19 +01:00
Florian Bruhin
18cd608493 Update docs 2017-11-06 13:47:50 +01:00
Florian Bruhin
29cbf75615 Merge remote-tracking branch 'origin/pr/3249' 2017-11-06 13:46:24 +01:00
Ryan Roden-Corrent
c74cb22374 Improve completion-item-yank documentation. 2017-11-06 07:34:31 -05:00
Florian Bruhin
f56692d836 Update changelog 2017-11-06 12:14:27 +01:00
Florian Bruhin
378b280f9a Fix qute://gpl 2017-11-06 12:13:54 +01:00
Florian Bruhin
55815bd17b Add some debug logging for #3219 2017-11-06 10:53:37 +01:00
Florian Bruhin
b55bb5dc6f Work around QUrl::query() not being available with PyQt 5.9.1
See https://www.riverbankcomputing.com/pipermail/pyqt/2017-November/039702.html
2017-11-06 08:50:03 +01:00
Florian Bruhin
2514b009af Use QUrlQuery to get log level on qute://log
This helps with
https://www.riverbankcomputing.com/pipermail/pyqt/2017-November/039702.html
2017-11-06 08:42:59 +01:00
Florian Bruhin
4d8ac7486c Go back to using subprocess.Popen for :restart
With subprocess.run, we wait until the subprocess has completed, which means the
parent process will hang on :restart.

Since we *don't* want to wait for the subprocess here, using subprocess.Popen
seems the right thing to do.

This was introduced in bb54a954fe / #3203
Probably doesn't affect #3210 and #3220.
2017-11-06 07:45:17 +01:00
Florian Bruhin
22f3fade24 Bump up default font size to 10pt
See #1585
2017-11-06 07:36:52 +01:00
Florian Bruhin
f52930c857 Make the window.hide_wayland_decoration option less special 2017-11-06 07:33:13 +01:00
Florian Bruhin
4fdf2d6f40 Update docs 2017-11-06 07:11:00 +01:00
Florian Bruhin
d8392d4852 Merge environment variable init tests 2017-11-06 07:05:32 +01:00
Florian Bruhin
341e8ca864 Add a qt.highdpi setting
See #1585
2017-11-06 07:02:07 +01:00
Florian Bruhin
4857374fb0 Update changelog 2017-11-06 06:53:47 +01:00
Florian Bruhin
f222aa30a6 Merge remote-tracking branch 'origin/pr/3250' 2017-11-06 06:53:11 +01:00
Florian Bruhin
e03fffe604 Update changelog 2017-11-06 06:49:21 +01:00
Florian Bruhin
fef6b8e5fb Merge remote-tracking branch 'origin/pr/3247' 2017-11-06 06:48:50 +01:00
Florian Bruhin
691a152ec8 Remove old config file 2017-11-06 06:48:23 +01:00
Jay Kamat
ca0aa68f74 Fix icon width calculation for pinned tabs 2017-11-05 23:23:33 -05:00
Michal Siedlaczek
9153bf8c19 Additional version() test 2017-11-05 20:12:29 -05:00
Michal Siedlaczek
855d0312b5 Review fixes 2017-11-05 18:12:15 -05:00
Michael Hoang
966aa810df Set maxsplit to 0 on :buffer
Remove double quotes from tests
2017-11-06 06:41:43 +11:00
Florian Bruhin
f6b6b2ed7d Merge pull request #3244 from sim590/cast-custom-path
userscripts/cast: effectively kill old proc
2017-11-05 18:18:06 +01:00
Ryan Roden-Corrent
db3b1aee0d Add default ctrl+c binding for completion yank.
By default, ctrl+c will yank the selection from the completion menu onto
the clipboard, and ctrl+shift+c will yank it onto the primary selection.

Unfortunately ctrl+y was already taken by rl-yank (which,
counter-intuitively to vim users, will paste the last deleted text).
2017-11-05 11:14:28 -05:00
Ryan Roden-Corrent
bb63f9fd92 Implement completion-item-yank.
Yank the text from the first column of the completion menu.
Resolves #1588.
2017-11-05 11:07:38 -05:00
Simon Désaulniers
3cb06f9a81 userscripts/cast: effectively kill old proc
Custom location installed castnow can't be killed with the command
`pkill -f /usr/bin/castnow`. Now recover the path to the binary in the path for
calling and killing the program.
2017-11-05 00:19:06 -04:00
Michal Siedlaczek
51a61cf02d Fix test: sort when comparing file collection 2017-11-04 20:03:53 -04:00
Michal Siedlaczek
9ea986a569 Fixed typo 2017-11-04 20:02:49 -04:00
Michal Siedlaczek
3ac2cfdf73 Support updating dictionaries and removing old versions. 2017-11-04 18:16:05 -04:00
Panagiotis K
5215321e64 Error handling, better code quality.
Handling of os errors raised during parent
directory creation.
2017-11-04 20:17:35 +02:00
Florian Bruhin
af93c0fbc0 Fix changelog
[ci skip]
2017-11-04 17:15:20 +01:00
Florian Bruhin
87c339587f Release v1.0.3
(cherry picked from commit fc63cea917)
2017-11-04 17:05:05 +01:00
Florian Bruhin
990be79933 Update changelog 2017-11-04 16:07:04 +01:00
Florian Bruhin
5689a3c0dc Fix unbinding default keys twice
When doing :unbind with a default keybinding the first time, it gets inserted
into bindings.commands with None as value.

When then doing :unbind a second time, instead of just leaving that None value
as-is, we removed it again (because it got treated as a custom binding).

Fixes #3162
2017-11-04 15:17:19 +01:00
Michal Siedlaczek
2dc0115c81 Load the newest version of the dictionary. 2017-11-03 19:20:31 -04:00
Michal Siedlaczek
16ad9182f1 Add en-AU (Australia) to the list of valid languages 2017-11-03 17:24:33 -04:00
Florian Bruhin
b8e1ed752f Update docs
(cherry picked from commit f85f31ebe92c961b29d5882dbf857cf75debd66d)
2017-11-03 15:03:05 +01:00
Florian Bruhin
c22a27d47f Add missing trailing dots
(cherry picked from commit 5f43b02badc20a4fc67931ab6e76f1050ab283aa)
2017-11-03 15:03:05 +01:00
Florian Bruhin
6233358b71 Sort codeowners file
(cherry picked from commit 291cddc170caf552b5ed3587bbe5096fac8111e4)
2017-11-03 15:03:05 +01:00
Florian Bruhin
864249d798 Merge remote-tracking branch 'origin/pr/3181' 2017-11-03 15:02:27 +01:00
Florian Bruhin
568bb5d540 Merge pull request #3229 from ryan-farley/import-moz-bookmarks
importer: add mozilla places.sqlite support
2017-11-03 14:41:10 +01:00
Florian Bruhin
0f28804032 Merge pull request #3237 from rcorre/completionsort
Fix completion sorting
2017-11-03 14:36:42 +01:00
Florian Bruhin
1c2f0c5359 Merge pull request #3232 from cryzed/qute-pass-userscript
Add qute-pass userscript
2017-11-03 14:36:11 +01:00
cryzed
600d2a543d Exit successfully when the user makes no selection 2017-11-03 13:54:43 +01:00
cryzed
4ec2e5485a Sort candidates alphabetically 2017-11-03 13:14:29 +01:00
cryzed
22dcd775da Improve warning message and adjust copyright 2017-11-03 11:57:23 +01:00
Florian Bruhin
1536c098cf Merge pull request #3215 from deewakar/issue3161
Add trailing slash to qute://help pages
2017-11-03 11:49:31 +01:00
cryzed
a96e4490ee Add qutebrowser license header and warning about login details in qute's debug log 2017-11-03 11:32:32 +01:00
cryzed
ee6b4bc7ee Add option to merge pass candidates for the fully-qualified and registered domain name 2017-11-03 11:25:35 +01:00
Ulrik de Muelenaere
ce1494e5ec Update stylesheet.js to ES6 2017-11-03 12:17:35 +02:00
Ulrik de Muelenaere
72c57d16f4 Merge branch 'master' into stylesheet 2017-11-03 12:13:52 +02:00
Florian Bruhin
d53a96d9f2 Merge pull request #3208 from 7lb/refactor/make_completer_less_stateful
[RDY] Make completer less stateful
2017-11-03 10:47:52 +01:00
Florian Bruhin
be325853d8 Revert "Inject JS into the profile"
This reverts commit acfb3aa26f.

The related code doesn't really belong in webenginesettings.py after all, and
for some reason I don't understand right now this breaks tests in
javascript.feature because window._qutebrowser is undefined when running them.
2017-11-03 09:59:00 +01:00
Florian Bruhin
25bda66260 Merge pull request #3191 from gyorb/refactor/enum
use Enum start number
2017-11-03 09:30:47 +01:00
Marcel Schilling
7e07f5c996 standardize placeholders in configdata descriptions
* Keep descriptions concise.
 * Prefer starting descriptions with a noun.
 * Don't explain that placeholders are placeholders/get replaced.
 * Introduce placeholder list by the following line:
   'The following placeholders are defined:'
 * List placeholders in a markdown-style list:
   '* `{<placeholder>}`: <description>.'
2017-11-03 08:48:30 +01:00
Marcel Schilling
af9c94bd23 add myself as codeowner for configdata YAML file
* to be notified of changes so I can help maintain consistency
2017-11-03 08:44:11 +01:00
Marcel Schilling
c6d7509220 rephrase configdata descriptions
* see discussion of PR #3181
2017-11-03 08:44:11 +01:00
Marcel Schilling
87ec7a1a0b prefer nouns for configdata descriptions
* reserve interrogative words for selection type options
2017-11-03 08:44:11 +01:00
Marcel Schilling
aebe4c8f9e assume single user in configdata descriptions
* 'a user' -> 'the user'
2017-11-03 08:44:11 +01:00
Marcel Schilling
a6451c05d7 add missing units to configdata descriptions
* fixes #3171
2017-11-03 08:44:11 +01:00
Marcel Schilling
01b29cd640 use interrogative words for configdata descriptions
* for selections, use appropriate determiner/pro-adverb/pronoun:
   * 'When to [...].'
   * 'How to [...].'
   * 'Which [...] to [...].'
   * 'What [...] to [...].'
2017-11-03 08:44:11 +01:00
Marcel Schilling
0a908206bc avoid boolean redundancy in configdata descriptions
* 'Enable or disable [...]' -> 'Enable [...]'
What else? ---^^^^^^^
2017-11-03 08:44:11 +01:00
Marcel Schilling
494aceec45 use imperative mood for bools in configdata descriptions
* considers ConfirmQuit and BoolAsk in addition to Bool
2017-11-03 08:44:11 +01:00
Marcel Schilling
f76af6c949 define type before desc in configdata YAML file 2017-11-03 08:44:11 +01:00
Marcel Schilling
b187a83d59 avoid spaces before colons in confidata YAML file
* '  desc : [...]' -> '  desc: [...]'
space ----^      no space ----^
2017-11-03 08:44:11 +01:00
Marcel Schilling
56671e5787 avoid articles in configdata descriptions
* includes `valid_value` descriptions in addition to `desc` fields
2017-11-03 08:44:11 +01:00
Marcel Schilling
e744a7c25a avoid code duplication in configdata descriptions
* available placeholders are defined for tabs.title.format
 * tabs.title.format_pinned refers to that definition
 * window.title.format repeats the identical(!) definition
 * this replaces the repetion by another reference
2017-11-03 08:44:11 +01:00
Marcel Schilling
fe8b9519c8 avoid redundancy in configdata descriptions
* drop phrases referring to the settings themselves:
   * 'set ...'
   * 'control ...'
   * 'definitons of ...'
2017-11-03 08:44:11 +01:00
Marcel Schilling
fd52409d0c standardize units in configdata descriptions
* encapsulate units in parentheses: ('(in <unit>)')
 * move units right behind the corresponding noun
2017-11-03 08:44:11 +01:00
Marcel Schilling
e126faf8c1 prefer 'duration' in configdata descriptions 2017-11-03 08:44:11 +01:00
Marcel Schilling
7672fb5241 avoid abbreviations in configdata description
* chars -> characters
 * px -> pixels
 * ms -> milliseconds
 * regexes -> regular expressions

 * includes `valid_value` descriptions in addition to `desc` fields

ms_fix
2017-11-03 08:44:11 +01:00
Marcel Schilling
99ad1547bc break long lines in configdata YAML file
* max. 79 chars (as per PEP8)
 * two long lines remain (as I didn't know how to safely break them):

>    389      - "http://malwaredomains.lehigh.edu/files/justdomains.zip"
> -> 390      - "https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext"
>    391    type:
> --
>   2222        Sh: open qute://history
> ->2223        xx: config-cycle statusbar.hide ;; config-cycle tabs.show always switching
>   2224        xt: config-cycle tabs.show always switching
2017-11-03 08:44:11 +01:00
Marcel Schilling
31e7d8dd3f fix capitalization in configdata descriptions
* url -> URL
 * os -> OS
 * Page Cache -> page cache
 * Spatial Navigation -> spatial navigation
2017-11-03 08:44:11 +01:00
Marcel Schilling
a55d12bf70 add missing periods (.) to configdata descriptions
* includes `valid_value` descriptions in addition to `desc` fields
2017-11-03 08:44:11 +01:00
Marcel Schilling
0c01d9b61a fixed typos in configdata descriptions 2017-11-03 08:44:11 +01:00
Ryan Roden-Corrent
a9926e44f0 Don't check date string in test_histcategory.
We really just need to check that the row exists here, the date doesn't
matter. Checking the date here is actually flaky with regards to time.
When running locally at 11:50 EST, it failed with:

```
assert self._model.data(self._model.index(row, col)) == item
AssertionError: assert '1969-12-31' == '1970-01-01'
- 1969-12-31
+ 1970-01-01
```

It was wrong to assume that an atime of 0 would always format to
1970-01-01.
2017-11-02 22:10:00 -04:00
Ryan Roden-Corrent
47447c047a Ensure completions are sorted after filtering.
I previously removed the sorting logic from SortFilter thinking it was
unnecessary if we construct the model with a sorted list. However, this
only worked when no pattern was set, and the items are misordered as
soon as a pattern is input.

This patch reintroduces alpha-sorting, which can be disabled by passing
sort=False to the ListCategory constructor. The session completion test
had to be tweaked as it simulated the incorrect assumption that the
session list is not alpha-ordered; sessions come out of the
session-manager pre-sorted so we may as well use alpha-sorting in the
session completion model.

Resolves #3156.
2017-11-02 22:10:00 -04:00
cryzed
78eb7b5da8 Select pass candidates for the fully-qualified domain name first, then for the registered domain and finally the IPv4 address if that is what the URL was 2017-11-03 02:43:33 +01:00
Florian Bruhin
acfb3aa26f Inject JS into the profile
Closes #3216
2017-11-02 21:59:22 +01:00
Florian Bruhin
a14ef88acf Remove some obsolete/deprecated eslint customizations 2017-11-02 20:00:29 +01:00
Florian Bruhin
1cf66976d2 Merge remote-tracking branch 'origin/pr/3225' 2017-11-02 19:43:04 +01:00
Luca Benci
c28d681736 Change test to avoid calling private functions 2017-11-02 19:42:33 +01:00
Florian Bruhin
bb208f4e77 Un-hide :open-editor
It can be used in normal mode as well, and it's nice to have it discoverable.
Fixes #3235.
2017-11-02 19:32:45 +01:00
Florian Bruhin
5469a238de Fix docs for new editor replacements
See #3100
2017-11-02 19:30:47 +01:00
Gyorgy Orban
98c6b49cde use enum module instead or usertypes.enum
Remove the usertypes.enum from the source and use
the standard enum module instead.
Enum start number is available since python 3.5
2017-11-02 18:56:11 +01:00
plexigras
6e624bcd3c Merge branch 'master' into es6ify-js 2017-11-02 16:44:25 +01:00
cryzed
16fefc1c7b Make changes suggested here: 0e3c42db69 2017-11-02 14:06:17 +01:00
Florian Bruhin
c0eae5d4e4 Update changelog 2017-11-02 11:35:40 +01:00
Florian Bruhin
9a69ccc9e3 Merge remote-tracking branch 'origin/pr/3100' 2017-11-02 11:32:45 +01:00
Florian Bruhin
4a1cdef887 Fix indent 2017-11-02 11:03:19 +01:00
Florian Bruhin
3385585ca5 Merge remote-tracking branch 'origin/pr/3203' 2017-11-02 11:02:49 +01:00
Florian Bruhin
4498141c8b Update changelog 2017-11-02 09:15:41 +01:00
Florian Bruhin
f620ffd9d4 Merge remote-tracking branch 'origin/pr/3228' 2017-11-02 09:14:49 +01:00
Florian Bruhin
1c39715267 Clarify qute://configdiff/old title 2017-11-01 22:36:59 +01:00
Ryan Farley
2e051ab008 importer: add mozilla places.sqlite support
This adds supports for the places.sqlite format as used by Firefox,
Seamonkey, Pale Moon, and presumably others. Search engine support is
limited to keyword-style '%s' functionality.

vulture whitelist for row_factory
2017-11-01 15:33:13 -05:00
cryzed
0e3c42db69 Rename qute-passmenu to qute-pass again 2017-11-01 20:40:59 +01:00
cryzed
6d37e4671a Add support for not automatically entering insert mode 2017-11-01 19:08:49 +01:00
cryzed
09d55cb271 Add support for only inserting the username or password 2017-11-01 19:01:17 +01:00
cryzed
c97b416cb1 Rename qute-pass to qute-passmenu 2017-11-01 18:19:46 +01:00
cryzed
19fc4de484 Add qute-pass userscript 2017-11-01 17:57:30 +01:00
Gyorgy Orban
bb54a954fe use subprocess run
The usage of subprocess.run is recommended since python 3.5.
Popen, check_call, call and check_output calls were replaced with run.
2017-11-01 09:59:32 +01:00
Florian Bruhin
385337eb90 Use lts version of NopeJS
Looks like npm doesn't work with Node v9:
https://github.com/nodejs/node/issues/16649
2017-11-01 09:24:57 +01:00
Jay Kamat
cb7e6ab02d Abort pinned tab prompt if tab is destroyed
Closes #3223
2017-10-31 19:07:01 -04:00
Luca Benci
24231ae405 Remove unnecessary parens 2017-10-31 23:22:17 +01:00
Luca Benci
bc0c877b87 Formatting 2017-10-31 23:21:37 +01:00
Luca Benci
370405c0ed Remove assert 2017-10-31 23:20:13 +01:00
Luca Benci
35597a7c01 Change tests for trailing-space behaviour change 2017-10-31 23:15:11 +01:00
Luca Benci
dcc53026a3 Stay within 79 columns 2017-10-31 23:14:07 +01:00
plexigras
fa8476f762 keep old pac_utils.js 2017-10-31 16:40:09 +01:00
Florian Bruhin
dc26808a94 Fix setting names in FAQ 2017-10-31 14:41:36 +01:00
plexigras
905c984148 change some lambdas to functions 2017-10-31 12:54:26 +01:00
plexigras
d4d791f14e es6ified js 2017-10-31 11:53:35 +01:00
Florian Bruhin
0b86b302a2 pylint: Turn off some more too-many-* stuff globally
Humans are just better at judging what's okay here than a machine.
2017-10-31 07:35:00 +01:00
dwagle
95539961a4 made some adjustments in tests/end2end/features/qutescheme.feature for the tests to pass. These are to account for changes made in f70740c, 4c9482b and aab7496 2017-10-31 12:08:43 +05:45
Florian Bruhin
2becc17099 Merge remote-tracking branch 'origin/pr/2966' 2017-10-31 07:15:52 +01:00
Florian Bruhin
dad7e7b9d2 Update changelog 2017-10-31 07:06:04 +01:00
Florian Bruhin
e9483bc485 Merge remote-tracking branch 'origin/pr/3122' 2017-10-31 07:05:38 +01:00
dwagle
f70740cc3a set original query parameters if any before redirecting to new_url 2017-10-31 11:47:06 +05:45
Ulrik de Muelenaere
95b41b311f Disable ESLint no-bitwise rule 2017-10-30 22:24:59 +02:00
Ulrik de Muelenaere
3adc2e0f83 Add filter to NodeIterator checking for styled nodes 2017-10-30 19:56:12 +02:00
Ulrik de Muelenaere
34b27437d0 Clarify function names in stylesheet.js 2017-10-30 19:55:37 +02:00
Ulrik de Muelenaere
0540a43995 Check for deleted window 2017-10-30 19:52:15 +02:00
Jay Kamat
64b6852ae3 Fix a couple style issues 2017-10-30 12:40:44 -04:00
dwagle
4c9482be84 added a Scenario: Opening link with qute://help to tests/end2end/features/qutescheme.feature 2017-10-30 17:49:22 +05:45
dwagle
aab7496916 fixes issue #3161 2017-10-30 17:09:45 +05:45
Florian Bruhin
43aa7423ab Update docs 2017-10-30 08:26:47 +01:00
Florian Bruhin
9d415587bc Mark flaky test as flaky 2017-10-30 07:05:54 +01:00
Florian Bruhin
08965399c5 Update changelog 2017-10-30 06:59:16 +01:00
Florian Bruhin
daee729fc2 Merge remote-tracking branch 'origin/pr/3200' 2017-10-30 06:58:46 +01:00
Florian Bruhin
3d53ffb7ef Bump up YAML load deadline some more 2017-10-30 06:55:55 +01:00
Ulrik de Muelenaere
2fe1a1db89 Remove unused variable 2017-10-29 00:23:11 +02:00
Ulrik de Muelenaere
51d48f6b00 Rewrite user stylesheet injection for WebEngine
This now works correctly in XML documents. The stylesheet is applied at
document creation to reduce flickering, and is updated if the
user_stylesheets setting is changed after page load.
2017-10-28 22:16:29 +02:00
Florian Bruhin
0d1e716760 Add Vim Vixen to list of alternatives 2017-10-28 18:20:17 +02:00
Florian Bruhin
023c59f8c0 Reset the webserver process correctly between tests
If we don't call before_test(), if the server shows an error, all following
tests will fail.

See #3207
2017-10-28 17:29:55 +02:00
Florian Bruhin
f44985548b Merge pull request #3211 from regines/cheatsheet-update
Update cheatsheet
2017-10-28 17:24:31 +02:00
Regina Hug
493468e08f Update cheatsheet
Fixes #2466
2017-10-28 17:35:35 +02:00
Jay Kamat
2a4163b2c7 Fix ellipsis on pinned tabs with index > 10
See #3209
2017-10-27 17:20:55 -04:00
Luca Benci
249164eb9b Fix test_quickcomplete_flicker
The test needed to be fixed because of how the completer behaviour
changed.

Before:
completer always scheduled a completion update on selection changed,
but the updates themselves were ignored if not needed.

Now:
completer only schedules completion updates when actually needed, but
never ignores a completion update.

So, before it was correct to check whether `set_model` was called, now
we must check if the completion was actually scheduled. This can be
done by checking the parameters with which `_change_completed_part`
is called, since a completion is scheduled only when `immediate=True`
2017-10-27 22:25:41 +02:00
Luca Benci
f5f11f7f4e Remove _ignore_change 2017-10-27 20:15:33 +02:00
Luca Benci
2947b75ab9 Make eslint happy 2017-10-27 19:52:10 +02:00
Ryan Roden-Corrent
8f068dda1b Disable pylint's too-many-boolean-expressions. 2017-10-27 07:23:41 -04:00
Florian Bruhin
17e0f6d23c Remove -f for :bind in configuring.asciidoc
[ci skip]
2017-10-27 07:15:25 +02:00
Ryan Roden-Corrent
24f466b2c3 Add --related flag to edit-url. 2017-10-26 22:13:35 -04:00
Jay Kamat
97d719b179 Add a simple benchmark for _update_tab_titles 2017-10-26 21:33:10 -04:00
Ryan Farley
879e8dfb2c fix D401 in importer 2017-10-26 17:09:45 -05:00
Florian Bruhin
dc01b4eaf0 Use Pygments for syntax highlighting 2017-10-26 22:42:55 +02:00
Florian Bruhin
d7dac40c2c Update Gentoo install instructions again 2017-10-26 21:38:37 +02:00
Ryan Roden-Corrent
6519f500a9 Add --private flag to edit_url.
The command :edit-url --private (or :edit-url -p) will spawn a new
private window with the url input from the editor.

I had to add 'Given I have a fresh instance' to the feature file to
ensure tests were not interfering.

Resolves #3185.
2017-10-26 07:21:51 -04:00
Florian Bruhin
02c996a785 Fix wrong 'When' in bdd file 2017-10-26 09:47:02 +02:00
Florian Bruhin
eee5f8263f Merge remote-tracking branch 'origin/pr/3179' 2017-10-26 09:43:42 +02:00
Florian Bruhin
c883d6b429 Merge remote-tracking branch 'origin/pr/3196' 2017-10-26 08:46:21 +02:00
Florian Bruhin
1c9dc581a4 Skip "Clearing history" test on Windows 2017-10-26 08:45:15 +02:00
Florian Bruhin
c443def24e Explicitly mention qute://configdiff/old link target
Thanks GitHub for just stripping the link...
2017-10-26 08:14:40 +02:00
Ryan Farley
5d2975293b remove unused import 2017-10-25 16:49:12 -05:00
Luca Benci
ff7edf79e7 Rethrow exception if we can't handle it 2017-10-25 22:53:54 +02:00
Luca Benci
ae2dad7d18 Only catch the correct exception 2017-10-25 22:43:17 +02:00
Luca Benci
3fd7fb3e14 Do not assume elem.selectionStart exists 2017-10-25 22:38:44 +02:00
Ryan Farley
3d87f4ebdf default to Netscape format for importer 2017-10-25 14:52:53 -05:00
Luca Benci
df3f0124fc Add test 2017-10-25 21:37:22 +02:00
Luca Benci
f195b7e4d2 Fix flake8 failures 2017-10-25 21:18:53 +02:00
Florian Bruhin
d8461d79cc Update changelog 2017-10-25 20:50:48 +02:00
Florian Bruhin
2ab441a5a3 Merge remote-tracking branch 'origin/pr/3129' 2017-10-25 20:49:55 +02:00
lxhillwind
4c7f6e5339 Update configfiles.py: line too long fix 2017-10-26 02:04:09 +08:00
lxhillwind
048b792c6f add <EOL> in :config-write-py generated file 2017-10-26 00:52:22 +08:00
lxhillwind
66c5350989 handle <EOL> of :config-write-py generated file 2017-10-26 00:06:53 +08:00
Florian Bruhin
2051a5d95e Stabilize :history-clear test
Something seems special with the previous view:source tab which prevents us
from loading the new page.

See #3003
2017-10-25 14:08:31 +02:00
Florian Bruhin
94f8bb9574 bdd tests: Make sure initial about:blank check is redone on restart
When we did "Given I have a fresh instance", we immediately did run the commands
without waiting for the initial about:blank load again.

With Qt 5.10, this causes issues as the loadFinished signal is emitted with
about:blank then, and not the real URL.

See #3003
2017-10-25 14:06:55 +02:00
Ryan Farley
38e3c1ee8f fix whitespace 2017-10-24 19:58:38 -05:00
Ryan Farley
137a7114e1 importer: documentation of bookmark types 2017-10-24 19:41:22 -05:00
Ryan Farley
4ed7fe731d removed wrong option 2017-10-24 17:31:42 -05:00
Florian Bruhin
ed2f473a8e Make it more clear that :messages helps with failing processes 2017-10-24 22:56:04 +02:00
Florian Bruhin
cb4aea2f69 Update/clarify some docs 2017-10-24 22:39:41 +02:00
Jay Kamat
cb6f4313d7 Lower tabbar cache bound and clean up code 2017-10-24 10:18:10 -04:00
Florian Bruhin
984dd1ba8c Fix remaining pylint/flake8 issues 2017-10-24 09:37:10 +02:00
Florian Bruhin
1d18e808b1 Merge remote-tracking branch 'origin/pr/3182' 2017-10-24 09:31:25 +02:00
Florian Bruhin
6b1519ed52 Regenerate docs 2017-10-24 08:57:45 +02:00
Florian Bruhin
43bca9793e Merge remote-tracking branch 'origin/pr/3136' 2017-10-24 08:57:28 +02:00
siddhugolu
c94327748e Merge branch 'master' of https://github.com/qutebrowser/qutebrowser into finer_pylint_pragmas 2017-10-24 12:20:13 +05:30
siddhugolu
570f1a849f modified as requested 2017-10-24 12:20:07 +05:30
Christopher Pezley
f67c445f3d Add test for opening non-ascii paths from command line. 2017-10-23 22:27:00 +02:00
Florian Bruhin
d2b315cac1 Update install instructions for Fedora/Gentoo
[ci skip]
2017-10-23 11:57:34 +02:00
Florian Bruhin
9fd53fd445 Add Anonymous to backers file
[ci skip]
2017-10-23 08:58:24 +02:00
Florian Bruhin
989d6d2b44 Add Kevin Kainan Li to backers
[ci skip]
2017-10-23 08:28:45 +02:00
siddhugolu
bc9d305354 modified as requested 2017-10-23 01:46:02 +05:30
siddhugolu
4862b2faf9 modified pylint pragmas 2017-10-22 23:52:35 +05:30
Luca Benci
1f521da134 Add missing full-stops 2017-10-22 20:03:46 +02:00
Luca Benci
96bbdb19e6 Add missing docstrings 2017-10-22 20:02:32 +02:00
Luca Benci
8b91a74aef Fix broken test after default config change 2017-10-22 20:02:06 +02:00
Christopher Pezley
f53d8135b0 Add test for opening non-ascii paths. 2017-10-22 19:39:46 +02:00
Christopher Pezley
96eff65690 Log when url contains characters not present in current locale. 2017-10-22 18:41:29 +02:00
Florian Bruhin
af98f9a77d Fix position in changelog
[ci skip]
2017-10-22 17:34:37 +02:00
Florian Bruhin
288fe3f808 Update changelog 2017-10-22 17:33:40 +02:00
Florian Bruhin
bd0289423e Merge remote-tracking branch 'origin/pr/3180' 2017-10-22 17:33:06 +02:00
Florian Bruhin
a704526582 Remove messages.unfocused 2017-10-22 17:30:47 +02:00
Ryan Farley
31f1025ff8 escape search engine URLs in importer 2017-10-21 18:12:25 -05:00
Michael Hoang
e5f2d27ed9 Ensure that a window with the given win_id exists 2017-10-22 08:22:45 +11:00
Luca Benci
56d29a1b5f Avoid scheduling spurious completion updates
Instead of setting `_ignore_change` to `True` before calling
`_change_completed_part` we just stop `_cmd` from emitting
`update_completion`.

This has the nice side-effect that when writing a complete command
`_ignore_change` was set to `True` regardless, and thus hitting space
would not update the completion view.

Now, hitting space will (as always) schedule a completion update that
now will not be incorrectly ignored
2017-10-21 23:20:37 +02:00
Jay Kamat
49daa7aab8 Add most recent tab bar to cache statistics 2017-10-21 16:18:23 -04:00
Christopher Pezley
bdfb9c60cc Fix issue where opening a file whose name contains characters not
present in locale would cause a crash.

Fixes qutebrowser/qutebrowser/1450
2017-10-21 21:01:07 +02:00
Florian Bruhin
34fc5335d9 Merge remote-tracking branch 'origin/pr/3176' 2017-10-21 19:04:01 +02:00
Florian Bruhin
13116b2679 Stabilize IPC test
We can get earlier log messages from objreg
2017-10-21 19:02:35 +02:00
Florian Bruhin
33df4eb865 Skip test_fake_haiku on Windows 2017-10-21 19:01:22 +02:00
Jay Kamat
5ba4e13cab Fix typo in :home on pinned tab test 2017-10-21 01:32:56 -04:00
Jay Kamat
b499474599 Prevent calling _tab_pinned on every tab twice 2017-10-21 00:32:05 -04:00
Jay Kamat
caae1c7008 Fix blowing cache for different icons 2017-10-20 22:13:54 -04:00
Jay Kamat
fde4495bc7 Clear cache on config changes 2017-10-20 16:35:11 -04:00
Luca Benci
dee0799e15 Avoid crash with LC_ALL=C and unicode filename 2017-10-20 22:06:59 +02:00
Jay Kamat
e705ea7e56 Rename _minimum_tab_size_hint_helper 2017-10-20 15:40:11 -04:00
Jay Kamat
f6cc9d53b8 Merge branch 'master' into jay/cache-tabsize 2017-10-20 15:24:22 -04:00
Florian Bruhin
4c2aeb01a8 Update docs 2017-10-20 12:47:48 +02:00
Florian Bruhin
589e9b7153 Fix string escaping in config.source test 2017-10-20 10:05:42 +02:00
Florian Bruhin
3dc06aad24 Update changelog 2017-10-20 09:15:22 +02:00
Florian Bruhin
128a16173e Merge remote-tracking branch 'origin/pr/3165' 2017-10-20 09:14:41 +02:00
Florian Bruhin
5fe6e60ffd Fix lint 2017-10-20 09:12:23 +02:00
Florian Bruhin
c3e9343a6d Update changelog for scrolling improvements
See #2233, #2822
2017-10-20 08:59:39 +02:00
Florian Bruhin
8504d41db3 Use Qt API for QtWebEngine scrolling
See #2233
Fixes #2822
2017-10-20 08:58:28 +02:00
Florian Bruhin
dd927ded6b Only update tab/window title on scroll if needed
This way, if {scroll_pos} is not in the window/tab title template,
we don't redraw anything unnecessarily.

See #2233
2017-10-20 08:25:43 +02:00
Florian Bruhin
280dddda6b Set backend in TestRectOnView.test_zoomed 2017-10-20 08:07:10 +02:00
Florian Bruhin
fd8e5e30c6 Re-add scroll filtering and disable it for mark/scroll tests
See #2233
2017-10-20 07:38:51 +02:00
Florian Bruhin
455b90ecad Log which dictionaries have been found
See #3166
2017-10-20 07:14:32 +02:00
Martin Fraga
2bfa853847 Add keyhint radius configuration option
The radius for the keyhint dialog box should be configurable vi via
c.keyhint.radius. The default was set to 6px, which is the previous
hardcoded value.
2017-10-19 02:03:59 -07:00
Luca Benci
9613deb89d Document new editor.command placeholders 2017-10-18 21:20:05 +02:00
Luca Benci
0436526203 Change default editor command 2017-10-18 21:08:22 +02:00
Luca Benci
9b177ae8e7 Remove single-function test class (move test out) 2017-10-18 20:33:14 +02:00
Luca Benci
937d0d0688 Add some more tests 2017-10-18 20:30:16 +02:00
Luca Benci
0d7a557396 Fix configtypes tests so that placeholder is True 2017-10-18 20:30:03 +02:00
Luca Benci
cf04219f79 Rename possible_placeholder to arg 2017-10-18 20:20:05 +02:00
Luca Benci
7907840ead Add full stops 2017-10-18 20:19:47 +02:00
Luca Benci
addccd7492 Move comment to docstring and fix typo 2017-10-18 20:19:09 +02:00
Florian Bruhin
378498bbd7 Add a test for multiple config.source() errors 2017-10-18 14:06:54 +02:00
Florian Bruhin
5a9042ab3e Add a config.source() method 2017-10-18 13:53:26 +02:00
Florian Bruhin
34787edf4e Add Xresources to config recipes
[ci skip]
2017-10-18 10:46:12 +02:00
Florian Bruhin
354c3c8c9b Handle unknown filetypes with qute://help 2017-10-18 09:02:39 +02:00
Luca Benci
6f1b9b7984 Add tests for line & column calculation 2017-10-17 23:19:10 +02:00
Luca Benci
06b990c0d1 Add ShellCommand tests for {file} 2017-10-17 23:03:42 +02:00
Luca Benci
f710536092 Move line and column calculation to own function 2017-10-17 22:48:43 +02:00
Luca Benci
233e72fef1 Adjust docstring 2017-10-17 22:38:11 +02:00
Florian Bruhin
9dc9bcaf39 Make standarddir work on HaikuOS
For some reason, it returns an empty DataLocation.
2017-10-17 22:37:14 +02:00
Luca Benci
e508224a46 Avoid the use of chained replaces 2017-10-17 22:35:01 +02:00
Luca Benci
b3445bc35a Add default value for caret_position 2017-10-17 22:08:54 +02:00
Ryan Farley
af8a5c58da use sys.exit 2017-10-17 14:48:56 -05:00
Ryan Farley
73c5666ff9 various importer fixes
* Line breaks reinserted
* None in place of ''
* Check for browser before selecting default input format (to fix
KeyError)
* Remove redundant -S option and clarify help to make it slightly more
obvious what output formats make sense
* Added long-form arguments and slightly more sensible names (not really a
fix, but I personally like having them)
2017-10-17 14:48:56 -05:00
Ryan Farley
a6ed079011 make browser argument optional 2017-10-17 14:48:56 -05:00
Ryan Farley
84b2b05254 help text mod
Browser choices are now formatted in the help text rather than listed
manually. Redundant line regarding output default removed from epilogue
2017-10-17 14:48:56 -05:00
Ryan Farley
d85a15f0a2 style, variable name typo 2017-10-17 14:48:56 -05:00
Ryan Farley
aa0613c6d8 support multiple input formats
This restructures things to better support future implementations of
other input formats. The default formats are specified in a global dict
of browsers, which prevents duplicating the list of choices for browser
in bother get_args() and main(), and a new option enables overriding of
the default.
2017-10-17 14:48:56 -05:00
Ryan Farley
799fe5deb3 default to new search format 2017-10-17 14:48:56 -05:00
Ryan Farley
898dde566d fix whitespace issues 2017-10-17 14:48:56 -05:00
Ryan Farley
c163f702c2 fix config.val in format 2017-10-17 14:48:56 -05:00
Ryan Farley
31bbc8c5b3 importer support for keywords and search engines
This allows importer.py to process Netscape HTML exports from Firefox
(and other Mozilla browsers) with three distinct types:
	* bookmarks (sans shortcuturl attribute)
	* keywords (bookmarks with a shortcuturl attribute)
	* searches (keywords with a URL containing a %s substitution)
The first two can be combined at will in either quickmark or bookmark
output formats, the only difference being that keywords will be used in
place of titles when exporting to quickmark format. Searches are
exported to qutebrowser.conf format, or the new config.py format.

Dictionaries are used in the import function for readability's sake, but
the command line arguments follow the same general formula of true-false
flags used to select input bookmark types and the output format.
2017-10-17 14:48:55 -05:00
Florian Bruhin
828ffd4979 Update changelog 2017-10-17 21:19:46 +02:00
Florian Bruhin
11f97f71f4 Merge remote-tracking branch 'origin/pr/3150' 2017-10-17 21:19:11 +02:00
Florian Bruhin
807b7701d5 Re-add blank line 2017-10-17 21:11:14 +02:00
Jay Kamat
62b6d62cd7 Clean up sub-module import and unneeded + 2017-10-17 14:22:18 -04:00
Jay Kamat
5d11a1fd75 Prevent :home from bypassing pinned tab warnings
Closes #3138
2017-10-17 11:37:37 -04:00
Jay Kamat
95761c5023 Fix crashes on qute_pylint module when not running in the root
Useful for editors that run from non-root directories for
integrations, but skips some tests. Shouldn't impact tests run normally.
2017-10-17 10:36:37 -04:00
Florian Bruhin
5c6a821b1e Update changelog 2017-10-17 15:35:58 +02:00
Florian Bruhin
96bec9f9d7 Fix error code for "database is locked"
See #2930
2017-10-17 15:35:23 +02:00
Florian Bruhin
12c9590524 Always use shortest match for completion.use_best_match 2017-10-17 15:01:37 +02:00
Florian Bruhin
4984c9d05c Update docs 2017-10-17 14:57:41 +02:00
Florian Bruhin
161b96be1e Fix long line 2017-10-17 13:10:00 +02:00
Florian Bruhin
bf1af698bd Merge pull request #3147 from fiete201/Fix_debian_install_instructions_for1.0.2
fix debian install instructions to fit debian9 and new apt
2017-10-17 13:10:40 +02:00
Fritz Reichwald
2fccc083af fix debian install instructions to fit debian9 and new apt 2017-10-17 12:03:27 +02:00
Florian Bruhin
4f263505ee Improve tests for partial matching 2017-10-17 11:49:46 +02:00
Florian Bruhin
2e64dda592 Clean up getting matching commands 2017-10-17 11:40:34 +02:00
Florian Bruhin
52423fa426 Remove unneeded variable 2017-10-17 11:37:19 +02:00
Florian Bruhin
c3441ae4a8 Update changelog 2017-10-17 11:34:46 +02:00
Florian Bruhin
c233099bca Merge remote-tracking branch 'origin/pr/3063' 2017-10-17 11:34:35 +02:00
Florian Bruhin
44e5dc1c5a Add a comment to @xfail_norun 2017-10-17 10:45:58 +02:00
Florian Bruhin
458a45c172 Remove old deprecated commands 2017-10-17 10:44:22 +02:00
Florian Bruhin
f1ddf58260 Add a deprecated :tab-detach 2017-10-17 10:30:47 +02:00
Florian Bruhin
f84af0a6fb Fix docstring 2017-10-17 09:33:20 +02:00
Florian Bruhin
ced4713fda Reverse if/else 2017-10-17 09:14:59 +02:00
Florian Bruhin
2c86788901 Update changelog 2017-10-17 09:14:02 +02:00
Florian Bruhin
cce4ff6d53 Merge remote-tracking branch 'origin/pr/3054' 2017-10-17 09:10:45 +02:00
Florian Bruhin
8d169597ae Fix lint for standardpaths_tester 2017-10-17 09:06:52 +02:00
Florian Bruhin
9470bff464 Merge pull request #3137 from qutebrowser/pyup-scheduled-update-10-16-2017
Scheduled weekly dependency update for week 42
2017-10-17 08:13:19 +02:00
Florian Bruhin
a8eae03ee9 Update release checklist 2017-10-17 07:52:43 +02:00
Florian Bruhin
373ad28d2e Release v1.0.2
(cherry picked from commit 55a88ceea6)
2017-10-17 07:46:02 +02:00
Florian Bruhin
14a63b8a82 Include appdata file in MANIFEST 2017-10-17 07:39:44 +02:00
Florian Bruhin
6bc35a1842 Remove blank lines 2017-10-17 07:39:09 +02:00
Florian Bruhin
dd683ea08c Merge remote-tracking branch 'origin/pr/3139' 2017-10-17 07:38:48 +02:00
Florian Bruhin
db874d8bba Show apps with/without QApplication in standardpaths_tester 2017-10-17 06:34:08 +02:00
Florian Bruhin
1a7612e559 Bump up yaml timeout a bit 2017-10-17 06:28:22 +02:00
Florian Bruhin
d8384ced0a Show better error message when trying to toggle with :set 2017-10-17 06:26:42 +02:00
Florian Bruhin
544c508fac Add standardpaths_tester.py 2017-10-17 06:22:40 +02:00
Florian Bruhin
8acd014d39 Ignore new Qt 5.10 debug build messages 2017-10-17 06:22:26 +02:00
suve
2ad7bafcdf Add "faq" and "help" links in appdata.xml file 2017-10-16 22:30:51 +02:00
suve
914d72a216 Remove the .desktop suffix from <id> in appdata.xml
This used to be required by the standard, but is no longer the case.
2017-10-16 22:26:46 +02:00
suve
30f7f7b03c Change <id> in appdata.xml to match the {tld}.{vendor}.{product} scheme 2017-10-16 22:05:07 +02:00
suve
18776456f3 Add <provides> to appdata.xml file 2017-10-16 21:58:58 +02:00
suve
3084e7be02 Add <categories> to appdata.xml file 2017-10-16 21:58:51 +02:00
suve
a76fdfe205 Add more URLs to appdata file 2017-10-16 21:55:24 +02:00
suve
1d5d6acdea Add <launchable> info to appdata.xml 2017-10-16 21:34:08 +02:00
suve
039edd8d85 Add a basic appdata.xml file 2017-10-16 21:32:53 +02:00
Aneesh Roy
50983f01b8 New tab opens as unrelated 2017-10-16 17:14:48 +01:00
pyup-bot
eec129807e Update hypothesis from 3.32.0 to 3.33.0 2017-10-16 16:53:15 +02:00
pyup-bot
dd70019d4c Update setuptools from 36.5.0 to 36.6.0 2017-10-16 16:53:13 +02:00
Aneesh Roy
4d780e23af Add tabs.close_mouse_button_on_bar ignore option 2017-10-16 15:49:19 +01:00
Aneesh Roy
674269724f Configurable behavior of close mouse button on bar 2017-10-16 15:44:52 +01:00
Florian Bruhin
e89fda189a Fix tab sizing when we get a QPainter and not a QStylePainter
I'm not sure yet how that happens, but I got a crash report for that.
See #3099
2017-10-16 13:44:51 +02:00
Florian Bruhin
e766fe14fc Fix HTML escaping in completion 2017-10-16 12:27:13 +02:00
Florian Bruhin
7adab9ec78 Fix long line 2017-10-16 09:58:44 +02:00
Florian Bruhin
5307b97ca5 Improve checkpyver error message 2017-10-16 09:24:31 +02:00
Florian Bruhin
caeab959a5 Update changelog 2017-10-16 08:32:11 +02:00
Florian Bruhin
8756997dc8 Merge remote-tracking branch 'origin/pr/3099' 2017-10-16 08:30:03 +02:00
Florian Bruhin
09868c1e7f Update docs 2017-10-16 08:17:45 +02:00
Florian Bruhin
3797b0cfed Merge remote-tracking branch 'origin/pr/3034' 2017-10-16 08:12:15 +02:00
Florian Bruhin
3d02feac2b Merge pull request #3118 from jgkamat/jay/git-version
Change qute:version git commit to display hash
2017-10-16 07:59:52 +02:00
Florian Bruhin
2a65cadb67 Fix setting monospace fonts with None values
Fixes #3130
2017-10-16 06:18:09 +02:00
Florian Bruhin
e003b11670 Fix overflow handling for QtWebKit scrolling
If we do "m * val / 100", the value gets bigger, so we need to check for an
overflow afterwards.
2017-10-15 22:30:17 +02:00
Florian Bruhin
fa4a66f7b3 Add SQLITE_READONLY to environmental errors 2017-10-15 21:10:11 +02:00
Adrien Folie
57e1135abe fix blurry favicons on hidpi displays 2017-10-15 19:24:15 +02:00
Florian Bruhin
e90a5f509e Improve install docs
[ci skip]
2017-10-15 12:25:57 +02:00
Florian Bruhin
392ea8825b Clarify completion keybinding changes
See #3125
[ci skip]
2017-10-15 12:21:14 +02:00
Florian Bruhin
af3c9a2b9e Update changelog 2017-10-15 00:29:45 +02:00
Florian Bruhin
16b2df56df Merge remote-tracking branch 'origin/pr/3115' 2017-10-15 00:27:14 +02:00
Florian Bruhin
2eba2cc8f5 Skip another history test on AppVeyor 2017-10-15 00:26:26 +02:00
Florian Bruhin
f4796b5ec6 Add missing period 2017-10-15 00:22:19 +02:00
Florian Bruhin
e3a305a814 Regenerate docs 2017-10-15 00:21:56 +02:00
Florian Bruhin
71f48a1e30 Move statusbar colors together in configdata.yml 2017-10-15 00:21:35 +02:00
Florian Bruhin
69d4bb6c6a Merge remote-tracking branch 'origin/pr/3119' 2017-10-15 00:20:47 +02:00
Jay Kamat
4ff44eff7b Clean up logic for finding git hash
Also add implementation for release scripts as well
2017-10-14 18:08:52 -04:00
Florian Bruhin
8f9bb67762 Merge pull request #3102 from rcorre/configuring_pylint
Note how to ignore pylint in configuring doc.
2017-10-15 00:05:11 +02:00
Jay Kamat
08b562ea0c Add caching for tab sizes 2017-10-14 17:59:50 -04:00
Florian Bruhin
01d2654c23 Improve history formatting in crashdialog 2017-10-14 22:27:30 +02:00
Florian Bruhin
bad349aacf Fix getting history in crash dialog 2017-10-14 22:23:03 +02:00
Kimat Boven
8ca0c87b1f FakeUrl had no url 2017-10-14 22:14:01 +02:00
Kimat Boven
ffab9e263f it was not possible to show the current_url in tab or window title
note that I couldn't use {url} as field for the FormatString
2017-10-14 22:14:01 +02:00
Florian Bruhin
5dacf1431f eslint: Disable multiline-comment-style 2017-10-14 21:41:56 +02:00
Florian Bruhin
27c46f20c0 Make sure the config default values are mutable
While the old values meant the same thing, they weren't mutable, so the config
couldn't modify them with a simple .append().

Fixes #3104
2017-10-14 16:40:44 +02:00
Florian Bruhin
97a14c14b3 Update changelog
[ci skip]
2017-10-14 12:50:34 +02:00
Florian Bruhin
0195f717c3 Move QOpenGL imports to the top
We don't support Qt < 5.4 anymore anyways.
2017-10-14 12:11:41 +02:00
Florian Bruhin
b3f395453b Run Nvidia shader workaround earlier
We need to do it before utils.opengl_vendor(), and it fits better there anyway.
This was a regression in v1.0.

See #2554, #3106
2017-10-14 12:10:21 +02:00
sMailund
f5cccfb097 re-add erroneously removed line 2017-10-14 10:43:34 +02:00
sMailund
14005e3684 trigger color change on passthrough mode 2017-10-14 10:30:44 +02:00
sMailund
57c4285dbc configure colorflags for passthrough mode 2017-10-14 10:29:34 +02:00
sMailund
4d2ca878ea add color configuration to passthrough mode 2017-10-14 10:26:55 +02:00
Jay Kamat
ee3d7463f6 Change qute:version git commit to display hash
Replaces output of git-describe

Closes #3095
2017-10-13 23:30:07 -04:00
Florian Bruhin
d411ec1eba Mark content.notifications as QtWebKit-only 2017-10-13 23:18:36 +02:00
Luca Benci
440740d30b Don't crash when opening editor under webkit 2017-10-13 20:40:08 +02:00
Ryan Roden-Corrent
dde50c23bc Fix up pylint notes in configuring.asciidoc.
- Use short form of pylint disable
- Update the following code block as well
- Add pylint ignore for missing-module-docstring
2017-10-13 07:44:26 -04:00
Florian Bruhin
db8fa5fdb6 Skip "History with invalid URL" test on Windows
For some reason, this hangs a lot on AppVeyor
2017-10-13 10:45:40 +02:00
Panagiotis K
630384e07f Fix tests. 2017-10-13 10:39:34 +03:00
Luca Benci
ad9ac2191b Also accept {file} placeholder 2017-10-12 23:48:49 +02:00
Luca Benci
6425061b3a Substitute new editor.command placeholders
Added placeholders are:

* `{file}` has the same function as `{}`
* `{line}` is the 1-based line number
* `{column}` is the 1-based column number
* `{line0}` like `{line}`, but 0-based
* `{column0}` like `{column}` but 0-based
2017-10-12 22:46:05 +02:00
Luca Benci
cdf4f69251 Pass caret_position to editor's edit() 2017-10-12 22:43:31 +02:00
Luca Benci
67e41af875 Add sanity check and accessor for caret_position 2017-10-12 22:43:06 +02:00
Luca Benci
f43a597370 Add cursor_position to serialize_elem output 2017-10-12 22:42:40 +02:00
Bryan Gilbert
0e527d2584 Consistently space + center favicons when using vertical tabs 2017-10-12 14:55:13 -04:00
Ryan Roden-Corrent
69ced4e033 Note how to ignore pylint in configuring doc.
The doc explains how to ignore flake8 errors, but the `c` and `config`
variables may also make pylint unhappy
2017-10-12 11:51:03 -04:00
Joakim Reinert
efef588c30 fix lints in completer 2017-10-12 14:43:22 +02:00
Panagiotis K
10388b0515 Remove an unused variable. 2017-10-12 15:16:35 +03:00
Panagiotis K
0a753915ff Prompt for non-existing download directories.
Closes #2120
2017-10-12 15:00:35 +03:00
Joakim Reinert
7c584e7b6c add optional interval argument to start function of Timer stubs
Fixes failing tests for completer
2017-10-12 13:02:37 +02:00
Michael Hoang
249e497d36 Add test for window completion 2017-10-11 17:18:13 +11:00
Michael Hoang
29f66dcd95 Merge :tab-detach with :tab-give 2017-10-11 17:18:12 +11:00
Michael Hoang
67437a0d5d Add :tab-give and :tab-take commands and tests 2017-10-11 16:27:35 +11:00
Michael Hoang
b7061dc7db Separate logic for resolving buffers from index 2017-10-11 16:27:35 +11:00
Luca Benci
c8d41a4f87 Make tests pass 2017-10-10 22:54:49 +02:00
Luca Benci
052c527e4c Avoid explicit config monkeypatching 2017-10-10 22:52:57 +02:00
Luca Benci
787e3db3d5 Move tests to test_runners.py 2017-10-10 22:51:40 +02:00
Luca Benci
5078080bb0 Add (not fully working) tests for use_best_match 2017-10-10 22:02:25 +02:00
Joakim Reinert
0226025308 add adjustable amount of chars required to update completions 2017-10-09 16:51:19 +02:00
Joakim Reinert
019d66a4c6 add adjustable delay for completion updates 2017-10-09 16:51:19 +02:00
Luca Benci
0578349e29 Default completion.use_best_match to false 2017-10-09 11:12:42 +02:00
Luca Benci
71048a1b55 Add (and use) completion.use_best_match config 2017-10-09 11:12:37 +02:00
Luca Benci
9d0dfd5726 Always run best-matching command 2017-10-09 11:12:28 +02:00
Josefson Fraga
92f9a8503e add required redirect (url,title,atime,redirect) 2017-10-03 01:55:31 -04:00
Josefson Fraga
665a76561e add insertions to ComandHistory table as well 2017-10-02 22:50:52 -04:00
Josefson Fraga
4dc232f259 pylint fixes 2017-10-02 13:54:24 -04:00
Josefson Fraga
c6d140a40a adding script to import history data from other browsers 2017-10-02 00:26:47 -04:00
Josefson Fraga
8cb6b832d1 script to import history data from other browsers 2017-10-02 00:24:59 -04:00
514 changed files with 23763 additions and 8234 deletions

View File

@@ -5,15 +5,15 @@ cache:
build: off
environment:
PYTHONUNBUFFERED: 1
PYTHON: C:\Python36\python.exe
PYTHON: C:\Python36-x64\python.exe
matrix:
- TESTENV: py36-pyqt59
- TESTENV: py36-pyqt511
- TESTENV: pylint
install:
- '%PYTHON% -m pip install -U pip'
- '%PYTHON% -m pip install -r misc\requirements\requirements-tox.txt'
- 'set PATH=%PATH%;C:\Python36'
- 'set PATH=C:\Python36-x64;%PATH'
test_script:
- '%PYTHON% -m tox -e %TESTENV%'

View File

@@ -12,6 +12,7 @@ exclude_lines =
def __repr__
raise AssertionError
raise NotImplementedError
raise utils\.Unreachable
if __name__ == ["']__main__["']:
[xml]

30
.flake8
View File

@@ -1,5 +1,8 @@
[flake8]
exclude = .*,__pycache__,resources.py
# B001: bare except
# B008: Do not perform calls in argument defaults. (fine with some Qt stuff)
# B305: .next() (false-positives)
# E128: continuation line under-indented for visual indent
# E226: missing whitespace around arithmetic operator
# E265: Block comment should start with '#'
@@ -19,32 +22,33 @@ exclude = .*,__pycache__,resources.py
# D103: Missing docstring in public function (will be handled by others)
# D104: Missing docstring in public package (will be handled by others)
# D105: Missing docstring in magic method (will be handled by others)
# D106: Missing docstring in public nested class (will be handled by others)
# D107: Missing docstring in __init__ (will be handled by others)
# D209: Blank line before closing """ (removed from PEP257)
# D211: No blank lines allowed before class docstring
# (PEP257 got changed, but let's stick to the old standard)
# D401: First line should be in imperative mood (okay sometimes)
# D402: First line should not be function's signature (false-positives)
# D403: First word of the first line should be properly capitalized
# (false-positives)
# D413: Missing blank line after last section (not in pep257?)
# A003: Builtin name for class attribute (needed for overridden methods)
ignore =
B001,B008,B305,
E128,E226,E265,E501,E402,E266,E722,E731,
F401,
N802,
P101,P102,P103,
D102,D103,D104,D105,D209,D211,D402,D403
D102,D103,D106,D107,D104,D105,D209,D211,D401,D402,D403,D413,
A003
min-version = 3.4.0
max-complexity = 12
putty-auto-ignore = True
putty-ignore =
/# pylint: disable=invalid-name/ : +N801,N806
/# pragma: no mccabe/ : +C901
tests/*/test_*.py : +D100,D101,D401
tests/conftest.py : +F403
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
# FIXME:conf
tests/unit/completion/test_models.py : +F821
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
copyright-check = True
copyright-regexp = # Copyright [\d-]+ .*
copyright-min-file-size = 110

4
.github/CODEOWNERS vendored
View File

@@ -6,3 +6,7 @@ tests/end2end/features/test_completion_bdd.py @rcorre
tests/unit/browser/test_history.py @rcorre
tests/unit/completion/* @rcorre
tests/unit/misc/test_sql.py @rcorre
qutebrowser/config/configdata.yml @mschilli87
qutebrowser/javascript/caret.js @artur-shaik

46
.github/CODE_OF_CONDUCT.md vendored Normal file
View File

@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at mail@qutebrowser.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

View File

@@ -1,9 +1,17 @@
IMPORTANT: I'm currently (July 2018) more busy than usual until September,
because of exams coming up. Review of non-trivial pull requests will thus be
delayed until then. If you're reading this note after mid-September, please
open an issue.
- 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.
- Either run the testsuite locally, or keep an eye on Travis CI / AppVeyor
after pushing changes.
See the full contribution docs for details:
- If you are stuck somewhere or have questions,
https://github.com/qutebrowser/qutebrowser#getting-help[please ask]!
See the full contribution documentation for details and other useful hints:
include::../doc/contributing.asciidoc[]

19
.gitignore vendored
View File

@@ -25,17 +25,20 @@ __pycache__
/.tox
/testresults.html
/.cache
/.pytest_cache
/.testmondata
/.hypothesis
/.mypy_cache
/prof
/venv
TODO
/scripts/testbrowser_cpp/webkit/Makefile
/scripts/testbrowser_cpp/webkit/main.o
/scripts/testbrowser_cpp/webkit/testbrowser
/scripts/testbrowser_cpp/webkit/.qmake.stash
/scripts/testbrowser_cpp/webengine/Makefile
/scripts/testbrowser_cpp/webengine/main.o
/scripts/testbrowser_cpp/webengine/testbrowser
/scripts/testbrowser_cpp/webengine/.qmake.stash
/scripts/testbrowser/cpp/webkit/Makefile
/scripts/testbrowser/cpp/webkit/main.o
/scripts/testbrowser/cpp/webkit/testbrowser
/scripts/testbrowser/cpp/webkit/.qmake.stash
/scripts/testbrowser/cpp/webengine/Makefile
/scripts/testbrowser/cpp/webengine/main.o
/scripts/testbrowser/cpp/webengine/testbrowser
/scripts/testbrowser/cpp/webengine/.qmake.stash
/scripts/dev/pylint_checkers/qute_pylint.egg-info
/misc/file_version_info.txt

View File

@@ -13,34 +13,33 @@ persistent=n
[MESSAGES CONTROL]
enable=all
disable=no-self-use,
fixme,
global-statement,
locally-disabled,
disable=locally-disabled,
locally-enabled,
too-many-ancestors,
too-few-public-methods,
too-many-public-methods,
suppressed-message,
fixme,
no-self-use,
cyclic-import,
bad-continuation,
too-many-instance-attributes,
blacklisted-name,
too-many-lines,
logging-format-interpolation,
logging-not-lazy,
broad-except,
bare-except,
eval-used,
exec-used,
ungrouped-imports,
suppressed-message,
too-many-return-statements,
duplicate-code,
global-statement,
wrong-import-position,
duplicate-code,
no-else-return,
# https://github.com/PyCQA/pylint/issues/1698
unsupported-membership-test,
unsupported-assignment-operation,
unsubscriptable-object
too-many-ancestors,
too-many-public-methods,
too-many-instance-attributes,
too-many-lines,
too-many-return-statements,
too-many-boolean-expressions,
too-many-locals,
too-many-branches,
too-many-statements,
too-few-public-methods
[BASIC]
function-rgx=[a-z_][a-z0-9_]{2,50}$
@@ -69,10 +68,10 @@ valid-metaclass-classmethod-first-arg=cls
[TYPECHECK]
ignored-modules=PyQt5,PyQt5.QtWebKit
ignored-classes=_CountingAttr
[IMPORTS]
# WORKAROUND
# For some reason, pylint doesn't know about some Python 3 modules on
# AppVeyor...
known-standard-library=faulthandler,http,enum,tokenize,posixpath,importlib,types
known-third-party=sip

View File

@@ -14,16 +14,24 @@ matrix:
services: docker
- os: linux
env: TESTENV=py36-pyqt571
- os: linux
env: TESTENV=py36-pyqt58
- os: linux
python: 3.5
env: TESTENV=py35-pyqt59
env: TESTENV=py35-pyqt571
- os: linux
env: TESTENV=py36-pyqt59-cov
env: TESTENV=py36-pyqt59
- os: linux
env: TESTENV=py36-pyqt510
- os: linux
env: TESTENV=py36-pyqt511-cov
# https://github.com/travis-ci/travis-ci/issues/9069
- os: linux
python: 3.7
sudo: required
dist: xenial
env: TESTENV=py37-pyqt511
- os: osx
env: TESTENV=py36 OSX=sierra
osx_image: xcode8.3
env: TESTENV=py37 OSX=sierra
osx_image: xcode9.2
language: generic
# https://github.com/qutebrowser/qutebrowser/issues/2013
# - os: osx
@@ -51,7 +59,11 @@ matrix:
env: TESTENV=eslint
language: node_js
python: null
node_js: node
node_js: "lts/*"
- os: linux
language: generic
env: TESTENV=shellcheck
services: docker
fast_finish: true
cache:

View File

@@ -1,6 +1,5 @@
recursive-include qutebrowser *.py
recursive-include qutebrowser/img *.svg *.png
recursive-include qutebrowser/test *.py
recursive-include qutebrowser/javascript *.js
graft qutebrowser/html
graft qutebrowser/3rdparty
@@ -8,11 +7,14 @@ graft icons
graft doc/img
graft misc/apparmor
graft misc/userscripts
recursive-include scripts *.py *.sh
graft misc/requirements
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/Makefile
include requirements.txt
include tox.ini
include qutebrowser.py
@@ -21,25 +23,21 @@ include qutebrowser/config/configdata.yml
prune www
prune scripts/dev
prune scripts/testbrowser_cpp
prune scripts/testbrowser/cpp
prune .github
exclude scripts/asciidoc2html.py
exclude doc/notes
recursive-exclude doc *.asciidoc
include doc/qutebrowser.1.asciidoc
include doc/changelog.asciidoc
prune tests
prune qutebrowser/3rdparty
prune misc/requirements
prune misc/docker
exclude pytest.ini
exclude qutebrowser.rcc
exclude qutebrowser/javascript/.eslintrc.yaml
exclude qutebrowser/javascript/.eslintignore
exclude doc/help
exclude .*
exclude misc/appveyor_install.py
exclude misc/qutebrowser.spec
exclude misc/qutebrowser.nsi
exclude misc/qutebrowser.rcc
global-exclude __pycache__ *.pyc *.pyo

View File

@@ -9,13 +9,11 @@ qutebrowser
// QUTE_WEB_HIDE
image:icons/qutebrowser-64x64.png[qutebrowser logo] *A keyboard-driven, vim-like browser based on PyQt5 and Qt.*
image:https://img.shields.io/pypi/l/qutebrowser.svg?style=flat["license badge",link="https://github.com/qutebrowser/qutebrowser/blob/master/LICENSE"]
image:https://img.shields.io/pypi/v/qutebrowser.svg?style=flat["version badge",link="https://pypi.python.org/pypi/qutebrowser/"]
image:https://travis-ci.org/qutebrowser/qutebrowser.svg?branch=master["Build Status", link="https://travis-ci.org/qutebrowser/qutebrowser"]
image:https://ci.appveyor.com/api/projects/status/5pyauww2k68bbow2/branch/master?svg=true["AppVeyor build status", link="https://ci.appveyor.com/project/qutebrowser/qutebrowser"]
image:https://codecov.io/github/qutebrowser/qutebrowser/coverage.svg?branch=master["coverage badge",link="https://codecov.io/github/qutebrowser/qutebrowser?branch=master"]
link:https://www.qutebrowser.org[website] | link:https://blog.qutebrowser.org[blog] | link:https://github.com/qutebrowser/qutebrowser/releases[releases]
link:https://www.qutebrowser.org[website] | link:https://blog.qutebrowser.org[blog] | https://github.com/qutebrowser/qutebrowser/blob/master/doc/faq.asciidoc[FAQ] | https://www.qutebrowser.org/doc/contributing.html[contributing] | link:https://github.com/qutebrowser/qutebrowser/releases[releases] | https://github.com/qutebrowser/qutebrowser/blob/master/doc/install.asciidoc[installing]
// QUTE_WEB_HIDE_END
qutebrowser is a keyboard-focused browser with a minimal GUI. It's based
@@ -44,8 +42,8 @@ Documentation
In addition to the topics mentioned in this README, the following documents are
available:
* https://qutebrowser.org/img/cheatsheet-big.png[Key binding cheatsheet]: +
image:https://qutebrowser.org/img/cheatsheet-small.png["qutebrowser key binding cheatsheet",link="https://qutebrowser.org/img/cheatsheet-big.png"]
* https://raw.githubusercontent.com/qutebrowser/qutebrowser/master/doc/img/cheatsheet-big.png[Key binding cheatsheet]: +
image:https://raw.githubusercontent.com/qutebrowser/qutebrowser/master/doc/img/cheatsheet-small.png["qutebrowser key binding cheatsheet",link="https://raw.githubusercontent.com/qutebrowser/qutebrowser/master/doc/img/cheatsheet-big.png"]
* link:doc/quickstart.asciidoc[Quick start guide]
* https://www.shortcutfoo.com/app/dojos/qutebrowser[Free training course] to remember those key bindings
* link:doc/faq.asciidoc[Frequently asked questions]
@@ -91,7 +89,7 @@ https://lists.schokokeks.org/mailman/listinfo.cgi/qutebrowser[mailinglist] at
mailto:qutebrowser@lists.qutebrowser.org[].
For security bugs, please contact me directly at mail@qutebrowser.org, GPG ID
https://www.the-compiler.org/pubkey.asc[0xFD55A072].
https://www.the-compiler.org/pubkey.asc[0x916eb0c8fd55a072].
Requirements
------------
@@ -99,7 +97,7 @@ Requirements
The following software and libraries are required to run qutebrowser:
* http://www.python.org/[Python] 3.5 or newer (3.6 recommended)
* http://qt.io/[Qt] 5.7.1 or newer with the following modules:
* http://qt.io/[Qt] 5.7.1 or newer (5.11.1 recommended) with the following modules:
- QtCore / qtbase
- QtQuick (part of qtbase in some distributions)
- QtSQL (part of qtbase in some distributions)
@@ -109,12 +107,12 @@ The following software and libraries are required to run qutebrowser:
link:https://github.com/annulen/webkit/wiki[updated fork] (5.212) is
supported
* http://www.riverbankcomputing.com/software/pyqt/intro[PyQt] 5.7.0 or newer
(5.9 recommended) for Python 3
(5.11.2 recommended) for Python 3
* https://pypi.python.org/pypi/setuptools/[pkg_resources/setuptools]
* http://fdik.org/pyPEG/[pyPEG2]
* http://jinja.pocoo.org/[jinja2]
* http://pygments.org/[pygments]
* http://pyyaml.org/wiki/PyYAML[PyYAML]
* https://github.com/yaml/pyyaml[PyYAML]
* http://www.attrs.org/[attrs]
The following libraries are optional:
@@ -182,7 +180,9 @@ Active
* Firefox addons (based on WebExtensions):
https://addons.mozilla.org/en-GB/firefox/addon/vimium-ff/[Vimium-FF] (experimental),
https://key.saka.io[Saka Key],
https://github.com/cmcaine/tridactyl[Tridactyl] (in early development, working
https://github.com/ueokande/vim-vixen[Vim Vixen],
https://github.com/shinglyu/QuantumVim[QuantumVim],
https://github.com/cmcaine/tridactyl[Tridactyl] (working
on a https://bugzilla.mozilla.org/show_bug.cgi?id=1215061[better API] for
keyboard integration in Firefox).
@@ -200,7 +200,6 @@ main inspiration for qutebrowser)
http://www.vimperator.org/[Vimperator],
http://5digits.org/pentadactyl/[Pentadactyl],
https://github.com/akhodakivskiy/VimFx[VimFx],
https://github.com/shinglyu/QuantumVim[QuantumVim]
* Chrome/Chromium addons:
https://chrome.google.com/webstore/detail/vichrome/gghkfhpblkcmlkmpcpgaajbbiikbhpdi?hl=en[ViChrome],
https://github.com/jinzhu/vrome[Vrome]

View File

@@ -13,47 +13,75 @@ Thanks a lot to the following people who contributed to it:
Gold sponsors
~~~~~~~~~~~~~
TODO
- Iggy
- zwitschi
- 2x Anonymous
Silver sponsors
~~~~~~~~~~~~~~~
TODO
- https://benary.org[benaryorg]
- https://scratchbook.ch[Claude]
- Martin Tournoij
- http://supported.elsensohn.ch[Thomas Elsensohn]
- Christian Helbling
- Gavin Troy
- Chris King-Parra
- Tim Das Mool Wegener
Other sponsors
~~~~~~~~~~~~~~
TODO: people with t-shirts or higher pledge levels
- 7scan
- AMD1212
- Alex
- Alex Suykov
- Alexey Zhikhartsev
- Allan Nordhøy
- Anirudh Sanjeev
- Anssi Puustinen
- Anton Grensjö
- Aristaeus
- Armin Fisslthaler
- Ashley Hauck
- Benedikt Steindorf
- Bernardo Kuri
- Blaise Duszynski
- Bostan
- Bruno Oliveira
- BunnyApocalypse
- Christian Kellermann
- Colin Jacobs
- Daniel Andersson
- Daniel Nelson
- Daniel P. Schmidt
- Daniel Salby
- Danilo
- David Beley
- David Hollings
- David Keijser
- David Parrish
- Derin Yarsuvat
- Dmytro Kostiuchenko
- Eero Kari
- Epictek
- Eric
- Faure Hu
- Ferus
- Frederik Thorøe
- G4v4g4i
- Granitosaurus
- Gyula Teleki
- H
- Heinz Bruhin
- Hosaka
- Ihor Radchenko
- Iordanis Grigoriou
- Isaac Sandaljian
- Jakub Podeszwik
- Jamie Anderson
- Jasper Woudenberg
- Jay Kamat
- Jens Højgaard
- Johannes
- John Baber-Lucero
@@ -61,9 +89,11 @@ TODO: people with t-shirts or higher pledge levels
- Kenichiro Ito
- Kenny Low
- Lars Ivar Igesund
- Leulas
- Lucas Aride Moulin
- Ludovic Chabant
- Lukas Gierth
- Magnus Lindström
- Marulkan
- Matthew Chun-Lum
- Matthew Cronen
@@ -80,7 +110,10 @@ TODO: people with t-shirts or higher pledge levels
- Peter Rice
- Philipp Middendorf
- Pkill9
- PluMGMK
- Prescott
- ProXicT
- Ram-Z
- Robotichead
- Roshless
- Ryan Ellis
@@ -90,35 +123,53 @@ TODO: people with t-shirts or higher pledge levels
- Sean Herman
- Sebastian Frysztak
- Shelby Cruver
- Simon Désaulniers
- SirCmpwn
- Soham Pal
- Stephan Jauernick
- Stewart Webb
- Sven Reinecke
- Timothée Floure
- Tom Bass
- Tom Kirchner
- Tomas Slusny
- Tomasz Kramkowski
- Tommy Thomas
- Tuscan
- Ulrich Pötter
- Vasilij Schneidermann
- Vlaaaaaaad
- XTaran
- Z2h-A6n
- ayekat
- beanieuptop
- cee
- craftyguy
- demure
- dlangevi
- epon
- evenorbert
- fishss
- gsnewmark
- guillermohs9
- hernani
- hubcaps
- jnphilipp
- lobachevsky
- neodarz
- nihlaeth
- notbenh
- nyctea
- ongy
- patrick suwanvithaya
- pyratebeard
- p≡p foundation
- randm_dave
- sabreman
- toml
- vimja
- wiz
- 43 Anonymous
- 48 Anonymous
2016
----
@@ -212,6 +263,7 @@ Other sponsors
- Julie Engel
- Jörg Behrmann
- Jørgen Skancke
- Kevin Kainan Li
- Kevin Velghe
- Konstantin Shmelkov
- Kyle Frazer

View File

@@ -15,10 +15,642 @@ 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.5.0 (unreleased)
-------------------
Fixed
~~~~~
- Rare crash when an error occurs in downloads.
v1.4.0
------
Added
~~~~~
- Support for the bundled `sip` module in PyQt 5.11 and other changes in
Qt/PyQt 5.11.x.
- New `--debug-flag log-requests` to log requests to the debug log for
debugging.
- New `--first` flag for `:hint` (bound to `gi` for inputs) which automatically
selects the first hint.
- New `input.escape_quits_reporter` setting which can be used to avoid
accidentally quitting the crash reporter when pressing escape.
- New `qute-lastpass` userscript which uses the LastPass CLI to fill passwords.
- The Makefile now installs a `/usr/share/metainfo/qutebrowser.appdata.xml` file.
- QtWebEngine: Support for printing from webpages via `window.print`.
- QtWebEngine: Support for muting tabs:
* New `{audio}` field for `window.title_format` and `tabs.title.format` which
displays `[M]`/`[A]` for muted/recently audible tabs.
* New `:tab-mute` command (bound to `<Alt-m>`) to mute/unmute a tab.
- QtWebEngine: Support for `content.cookies.accept` with third-party cookies
blocked by default (requires Qt 5.11).
- QtWebEngine: New settings:
* Support for requesting persistent storage via
`navigator.webkitPersistentStorage.requestQuota` with a new
`content.persistent_storage` setting (requires Qt 5.11).
This setting also supports URL patterns.
* Support for registering custom protocol handlers via
`navigator.registerProtocolHandler` with a new
`content.register_protocol_handler` setting (requires Qt 5.11).
This setting also supports URL patterns.
* Support for WebRTC screen sharing with a new `content.desktop_capture`
setting (requires Qt 5.10).
This setting also supports URL patterns.
* New `content.autoplay` setting to enable/disable automatic video playback
(requires Qt 5.10).
* New `content.webrtc_public_interfaces_only` setting to only expose public
interfaces over WebRTC (requires Qt 5.9.2 or 5.11).
* New `content.canvas_reading` setting to disable reading from canvas
elements.
Changed
~~~~~~~
- The following settings now support URL patterns:
* `content.headers.do_not_track`
* `content.headers.custom`
* `content.headers.accept_language`
* `content.headers.user_agent`
* `content.ssl_strict`
* `content.geolocation`
* `content.notifications`
* `content.media_capture`
- The Windows/macOS releases now bundle Qt 5.11.1 which is based on
Chromium 65.0.3325.151 with security fixes up to Chromium 67.0.3396.87.
- New short flags for commandline arguments: `-B` and `-T` for `--basedir` and
`--temp-basedir`; `-d` and `-D` for `--debug` and `--debug-flag`.
- Deleting history items via `:history-clear` or `:completion-item-del` now
also removes that URL from QtWebEngine's visited links.
- There's now completion for commands taking a variable count of arguments
(like `:config-cycle`).
- QtWebEngine: On Qt 5.11.1, no reloads are needed anymore when switching
between pages with changed settings (e.g. `content.javascript.enabled`).
- The `qt.force_software_rendering` setting changed from a boolean to taking
different values (`software-opengl`, `qt-quick` and `chromium`) for different
kinds of software rendering workarounds.
- On Qt 5.11, using wayland with QtWebEngine is now possible when using
software rendering.
- GreaseMonkey scripts now get their own global scope (based on the page's
one), which allows scripts like OneeChan to work.
- Rapid hinting is now supported with the `yank` and `yank-primary` targets,
copying newline-separated links.
- QtWebEngine: On Qt 5.11, the developer tools (inspector) can now be used
securely and without requiring the `--enable-webengine-inspector` option.
- The `<Enter>` key (`:follow-selected`) now follows the currently focused
element if there's no selection.
- The `--logfilter` argument now can be prepended with an exclamation mark
(e.g. `--logfilter '!init,destroy'`) to invert the filter.
- `:view-source` now has a `--pygments` flag which uses the "old" way of
rendering sources even with QtWebEngine.
- Improved error messages when a setting needs a newer Qt version.
- QtWebEngine: Various improvements to make the cursor more visible in caret
browsing.
- When a prompt is opened in insert/passthrough mode, the mode is restored
after closing the prompt.
- On Qt 5.10 or newer, dictionaries are now read from the qutebrowser data
directory (e.g. `~/.local/share/qutebrowser`) instead of `/usr/share/qt`.
Existing dictionaries are copied over.
- If an error while parsing `~/.netrc` occurs, the cause of the error is now
logged.
- On Qt 5.9 or newer, certificate errors now show Chromium's detailed error
page.
- Greasemonkey scripts now support a "@qute-js-world" tag to run them in a
different JavaScript context.
Fixed
~~~~~
- Various subtle keyboard focus issues.
- The security fix in v1.3.3 caused URLs with ampersands
(`www.example.com?one=1&two=2`) to send the wrong arguments when clicked on
the `qute://history` page.
- Crash when opening a PDF page with PDF.js enabled (on QtWebKit), but no
PDF.js installed.
- Crash when closing a tab shortly after opening it.
Removed
~~~~~~~
- No prebuilt binaries for 32-bit Windows are supplied anymore. This is due to
Qt removing QtWebEngine support for those upstream. It might be possible to
distribute 32-bit binaries again with Qt 5.12 in December, but that will only
happen if it turns out enough people actually need 32-bit support.
- `:tab-detach` which has been deprecated in v1.1.0 has been removed.
- The `content.developer_extras` setting got removed. On QtWebKit, developer
extras are now automatically enabled when opening the inspector.
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.
Fixed
~~~~~
- Crash in a workaround for a Qt 5.11 bug in rare circumstances.
- Workaround for a Qt bug which preserves searches between page loads.
- In v1.3.2 a dependency on the `PyQt5.QtQuickWidgets` module was accidentally
introduced. Since that module isn't packaged everywhere, it's been removed
again.
v1.3.2
------
Fixed
~~~~~
- QtWebEngine: Improved workaround for a bug in Qt 5.11 where only the
top/bottom half of the window is used.
- QtWebEngine: Work around a bug in Qt 5.11 where an endless loading-loop is
triggered when clicking a link with an unknown scheme.
- QtWebEngine: When switching between pages with changed settings, less
unnecessary reloads are done now.
- QtWebEngine: It's now possible to open external links such as `magnet://` or
`mailto:` via hints.
v1.3.1
------
Fixed
~~~~~
- Work around a bug in Qt 5.11 where only the top/bottom half of the window is used.
This workaround is incomplete, but fixes the majority of the cases where this happens.
- Work around keyboard focus issues with Qt 5.11.
- Work around an issue in Qt 5.11 where e.g. activating JavaScript per-domain
needed a manual reload in some cases.
- Don't crash when a ² key is pressed (e.g. on AZERTY keyboards).
- Don't crash when a tab is opened and quickly closed again.
v1.3.0
------
Added
~~~~~
- New `:scroll-to-anchor` command to scroll to an anchor in the document.
- New `url.open_base_url` option to open the base URL of a searchengine when no
search term is given.
- New `tabs.min_width` setting to configure the minimal width for tabs.
- New userscripts:
* `getbib` to download bibtex information for DOIs on a page.
* `qute-keepass` to get passwords from KeePassX.
Changed
~~~~~~~
- QtWebEngine: Support for JavaScript Shared Web Workers have been disabled on
Qt versions older than 5.11 because of security issues in in Chromium.
You can get the same effect in earlier versions via
`:set qt.args ['disable-shared-workers']`. An equivalent workaround is also
contained in Qt 5.9.5 and 5.10.1.
- The file dialog for downloads now has basic tab completion based on the
entered text.
- `:version` now shows OS information for POSIX OS other than Linux/macOS.
- When there's an error inserting the text from an external editor, a backup
file is now saved.
- The `window.hide_wayland_decoration` setting got renamed to
`window.hide_decoration` and now also works outside of wayland.
- The `tabs.favicons.show` setting now can take three values: `'always'` (was
`True`), `'never'` (was `False`) and `'pinned'` (to only show favicons for
pinned tabs).
- Hover tooltips on tabs now always show the webpage's title.
- The default value for `content.host_blocking.lists` was changed to only
include https://github.com/StevenBlack/hosts[Steven Black's hosts-list] which
combines various sources.
- Error messages when trying to wrap when `tabs.wrap` is `False` are now logged
to debug instead of messages.
Fixed
~~~~~
- Using hints before a page is fully loaded is now possible again.
- Selecting hints with the number keypad now works again.
- Tab titles for tabs loaded from sessions should now really be correct instead
of showing the URL.
- Loading URLs with customized settings from a session now avoids an additional
reload.
- The window icon and title now get set correctly again.
- The `tabs.switching_delay` setting now has a correct maximum value limit set.
- The `taskadd` script now works properly when there's multi-line output.
- QtWebEngine: Worked around issues with GreaseMonkey/stylesheets not being
loaded correctly in some situations.
- The statusbar now more closely reflects the caret mode state.
- The icon on Windows should now be displayed in a higher resolution.
- The QtWebEngine development tools (inspector) now also work when JavaScript is
disabled globally.
- Building `.exe` files now works when `upx` is installed on the system.
- The keyhint widget now shows the correct text for chained modifiers.
- Loading GreaseMonkey scripts now also works with Jinja2 2.8 (e.g. on Debian
Stable).
- Adding styles with GreaseMonkey on fast sites now works properly.
- Window ID 0 is now excluded properly from `:tab-take` completion.
- A rare crash when cancelling a download has been fixed.
- The Makefile (intended for packagers) now supports `PREFIX` properly.
- The workaround for a black window with Nvidia graphics is now enabled on
non-Linux systems (like FreeBSD) as well.
- Initial support for Qt 5.11.
- Checking for a new version after sending a crash report now works properly
again.
- `@match` in Greasemonkey scripts now more closely matches the proper pattern
syntax.
- Searching via `/` or `?` now doesn't handle any characters in a special way.
- Fixed crash when trying to retry some failed downloads on QtWebEngine.
- An invalid spellcheck dictionary filename now doesn't crash anymore.
- When no spellcheck dictionaries are configured, it's now disabled internally.
This works around an issue with entering special characters on Facebook
messenger.
- The macOS release now should work again on macOS 10.11 and newer.
v1.2.1
------
Fixed
~~~~~
- qutebrowser now starts properly when the PyQt5 QOpenGLFunctions package wasn't
found.
- The keybinding cheatsheet on the quickstart page is now loaded from a local
`qute://` URL again.
- With "tox -e mkvenv-pypi", PyQt 5.10.0 is used again instead of Qt 5.10.1,
because of an issue with Qt 5.10.1 which causes qutebrowser to fail to start
("Could not find QtWebEngineProcess").
- Unbinding keys which were bound in older qutebrowser versions now doesn't
crash anymore.
- Fixed a crash when reloading a page which wasn't fully loaded with v1.2.0
- Keys on the numeric keypad now fall back to the same bindings without `Num+`
if no `Num+` binding was found.
- Fixed hinting on some pages with Qt < 5.10.
- Titles are now displayed correctly again for tabs which are cloned or loaded
from sessions.
- Shortcuts now correctly use `Ctrl` instead of `Command` on macOS again.
v1.2.0
------
Added
~~~~~
- Initial implementation of per-domain settings:
* `:set` and `:config-cycle` now have a `-u`/`--pattern` argument taking a
https://developer.chrome.com/extensions/match_patterns[URL match pattern]
for supported settings.
* `config.set` in `config.py` now takes a third argument which is the pattern.
* New `with config.pattern('...') as p:` context manager for `config.py` to
use the shorthand syntax with a pattern.
* New `tsh` keybinding to toggle scripts for the current host. With a capital
`S`, the toggle is saved. With a capital `H`, subdomains are included. With
`u` instead of `h`, the exact current URL is used.
* New `tph` keybinding to toggle plugins, with the same additional binding
described above.
- New QtWebEngine features:
* Caret/visual mode
* Authentication via ~/.netrc
* Retrying downloads with Qt 5.10 or newer
* Hinting and other features inside same-origin frames
- New flags for existing commands:
* `:session-load` has a new `--delete` flag which deletes the
session after loading it.
* New `--no-last` flag for `:tab-focus` to not focus the last tab when focusing
the currently focused one.
* New `--edit` flag for `:view-source` to open the source in an external editor.
* New `--select` flag for `:follow-hint` which acts like the given string was entered but doesn't necessary follow the hint.
- New special pages:
* `qute://bindings` (opened via `:bind`) which shows all keybindings.
* `qute://tabs` (opened via `:buffer`) which lists all tabs.
- New settings:
* `statusbar.widgets` to configure which widgets should be shown in which
order in the statusbar.
* `tabs.mode_on_change` which replaces `tabs.persist_mode_on_change`. It can
now be set to `restore` which remembers input modes (input/passthrough)
per tab.
* `input.insert_mode.auto_enter` which makes it possible to disable entering
insert mode automatically when an editable element was clicked. Together
with `input.forward_unbound_keys`, this should allow for emacs-like
"modeless" keybindings.
- New `:prompt-yank` command (bound to `Alt-y` by default) to yank URLs
referenced in prompts.
- The `hostblock_blame` script which was removed in v1.0 was updated for the new
config and re-added.
- New `cycle-inputs.js` script in `scripts/` which can be used with `:jseval -f`
to cycle through inputs.
Changed
~~~~~~~
- Complete refactoring of key input handling, with various effects:
* emacs-like keychains such as `<Ctrl-X><Ctrl-C>` can now be bound.
* Key chains can now be bound in any mode (this allows binding unused keys in
hint mode).
* Yes/no prompts don't use keybindings from the `prompt` section anymore, they
have their own `yesno` section instead.
* Trying to bind invalid keys now shows an error.
* The `bindings.default` setting can now only be set in a `config.py`, and
existing values in `autoconfig.yml` are ignored.
- Improvements for GreaseMonkey support:
* `@include` and `@exclude` now support regex matches. With QtWebEngine and Qt
5.8 and newer, Qt handles the matching, but similar functionality will be
added in Qt 5.11.
* Support for `@requires`
* Support for the GreaseMonkey 4.0 API
- The sqlite history now uses write-ahead logging which should be
a performance and stability improvement.
- When an editor is spawned with `:open-editor` and `:config-edit`, the changes
are now applied as soon as the file is saved in the editor.
- The `hist_importer.py` script now only imports URL schemes qutebrowser can
handle.
- Deleting a prefix (`:`, `/` or `?`) via backspace now leaves command mode.
- Angular 1 elements and `<summary>`/`<details>` now get hints assigned.
- `:tab-only` with pinned tabs now still closes unpinned tabs.
- The `url.incdec_segments` option now also can take `port` as possible segment.
- QtWebEngine: `:view-source` now uses Chromium's `view-source:` scheme.
- Tabs now show their full title as tooltip.
- When there are multiple unknown keys in a autoconfig.yml, they now all get
reported in one error.
- More performance improvements when opening/closing many tabs.
- The `:version` page now has a button to pastebin the information.
- Replacements like `{url}` can now be escaped as `{{url}}`.
Fixed
~~~~~
- QtWebEngine bugfixes:
* Improved fullscreen handling with Qt 5.10.
* Hinting and scrolling now works properly on special `view-source:` pages.
* Scroll positions are now restored correctly from sessions.
* `:follow-selected` should now work in more cases with Qt > 5.10.
* Incremental search now flickers less and doesn't move to the second result
when pressing Enter.
* Keys like `Ctrl-V` or `Shift-Insert` are now correctly handled/filtered with
Qt 5.10.
* Fixed hangs/segfaults on exit with Qt 5.10.1.
* Fixed favicons sometimes getting cleared with Qt 5.10.
* Qt download objects are now cleaned up properly when a download is removed.
* JavaScript messages are now not double-HTML escaped anymore on Qt < 5.11
- QtWebKit bugfixes:
* Fixed GreaseMonkey-related crashes.
* `:view-source` now displays a valid URL.
- URLs containing ampersands and other special chars are now shown correctly
when filtering them in the completion.
- `:bookmark-add "" foo` can now be used to save the current URL with a custom
title.
- `:spawn -o` now waits until the process has finished before trying to show the
output. Previously, it incorrectly showed the previous output immediately.
- Suspended pages now should always load the correct page when being un-suspended.
- Exception types are now shown properly with `:config-source` and `:config-edit`.
- When using `:bookmark-add --toggle`, bookmarks are now saved properly.
- Crash when opening an invalid URL from an application on macOS.
- Crash with an empty `completion.timestamp_format`.
- Crash when `completion.min_chars` is set in some cases.
- HTML/JS resource files are now read into RAM on start to avoid crashes when
changing qutebrowser versions while it's open.
- Setting `bindings.key_mappings` to an empty value is now allowed.
- Bindings to an empty commands are now ignored rather than crashing.
Removed
~~~~~~~
- `QUTE_SELECTED_HTML` is now not set for userscripts anymore except when called
via hints.
- The `qutebrowser_viewsource` userscript has been removed as
`:view-source --edit` can now be used.
- The `tabs.persist_mode_on_change` setting has been removed and replaced by
`tabs.mode_on_change`.
v1.1.2
------
Changed
~~~~~~~
- Windows/macOS releases now bundle Qt 5.10.1 which includes security fixes from
Chromium up to version 64.0.3282.140.
Fixed
~~~~~
- QtWebEngine: Crash with Qt 5.10.1 when using :undo on some tabs.
- Compatibility with Python 3.7
v1.1.1
------
Fixed
~~~~~
- The Makefile now actually works.
- Fixed crashes with Qt 5.10 when closing a tab before it finished loading.
v1.1.0
------
Added
~~~~~
- Initial support for Greasemonkey scripts. There are still some rough edges,
but many scripts should already work.
- There's now a `misc/Makefile` file in releases, which should help
distributions which package qutebrowser, as they can run something like
`make -f misc/Makefile DESTDIR="$pkgdir" install` now.
- New fields for `window.title_format` and `tabs.title.format`:
* `{current_url}`
* `{protocol}`
- New settings:
* `colors.statusbar.passthrough.fg`/`.bg`
* `completion.delay` and `completion.min_chars` to update the completion less
often.
* `completion.use_best_match` to automatically use the best-matching
command in the completion.
* `keyhint.radius` to configure the edge rounding for the key hint widget.
* `qt.highdpi` to turn on Qt's High-DPI scaling.
* `tabs.pinned.shrink` (`true` by default) to make it possible
for pinned tabs and normal tabs to have the same size.
* `content.windowed_fullscreen` to show e.g. a fullscreened video in the
window without fullscreening that window.
* `tabs.persist_mode_on_change` to keep the current mode when
switching tabs.
* `session.lazy_restore` which allows to not load pages immediately
when restoring a session.
- New commands:
* `:tab-give` and `:tab-take`, to give tabs to another window, or take them
from another window.
* `:completion-item-yank` (bound to `<Ctrl-C>`) to yank the current
completion item text.
* `:edit-command` to edit the commandline in an editor.
* `search.incremental` for incremental text search.
- New flags for existing commands:
* `-o` flag for `:spawn` to show stdout/stderr in a new tab.
* `--rapid` flag for `:command-accept` (bound to `Ctrl-Enter` by default),
which allows executing a command in the completion without closing it.
* `--private` and `--related` flags for `:edit-url`, which have the
same effect they have with `:open`.
* `--history` for `:completion-item-focus` which causes it to go
through the command history when no text was entered. The default bindings for
cursor keys in the completion changed to use that, so that they can be used
again to navigate through completion items when a text was entered.
* `--file` for `:debug-pyeval` which makes it take a filename instead of a
line of code.
- New `config.source(...)` method for `config.py` to source another file.
- New `{line}` and `{column}` replacements for `editor.command` to position the
cursor correctly.
- New `qute-pass` userscript as alternative to `password_fill` which allows
selecting accounts via rofi or any other dmenu-compatile application.
- New `hist_importer.py` script to import history from Firefox/Chromium.
Changed
~~~~~~~
- Some settings got renamed:
* `tabs.width.bar` -> `tabs.width`
* `tabs.width.indicator` -> `tabs.indicator.width`
* `tabs.indicator_padding` -> `tabs.indicator.padding`
* `session_default_name` -> `session.default_name`
* `ignore_case` -> `search.ignore_case`
- Much improved user stylesheet handling for QtWebEngine which reduces
flickering and updates immediately after setting a stylesheet.
- High-DPI favicons are now used when available.
- The `asciidoc2html.py` script now uses Pygments (which is already a dependency
of qutebrowser) instead of `source-highlight` for syntax highlighting.
- The `:buffer` command now doesn't require quoting anymore, similar to `:open`.
- The `importer.py` script was largely rewritten and now also supports importing
from Firefox' `places.sqlite` file and Chrome/Chromium profiles.
- Various internal refactorings to use Python 3.5 and ECMAscript 6 features.
- If the `window.hide_wayland_decoration` setting is False, but
`QT_WAYLAND_DISABLE_WINDOWDECORATION` is set in the environment,
the decorations are still hidden.
- The `install_dict.py` script for QtWebEngine was renamed to `dictcli.py` and
can now also upgrade dictionaries correctly.
- `:undo` now can re-open multiple tabs after `:tab-only` was used.
- `:config-write-py` with a relative path now puts the file into the config
directory.
- The `qute://version` page now also shows the uptime of qutebrowser.
- qutebrowser now prompts to create a non-existing directory when starting a
download.
- `:jseval --file` now searches relative paths in a `js/` subdir in
qutebrowser's data dir, e.g. `~/.local/share/qutebrowser/js`.
- The current/default bindings are now shown in the ``:bind` completion.
- Empty categories are now hidden in the `:open` completion.
- Search terms for URLs and titles can now be mixed when filtering the
completion.
- The default font size for the UI got bumped up from 8pt to 10pt.
- Improved matching in the completion: The words entered are now matched in any
order, and mixed matches on URL/tite are possible.
- The system's default encoding (rather than UTF-8) is now used to decode
subprocess output.
- qutebrowser now ensures it's focused again after an external editor is closed.
- The `colors.completion.fg` setting can now be a list, allowing to specify
different colors for the three completion columns.
Fixed
~~~~~
- More consistent sizing for favicons with vertical tabs.
- Using `:home` on pinned tabs is now prevented.
- Fix crash with unknown file types loaded via `qute://help`.
- Scrolling performance improvements.
- Sites like `qute://help` now redirect to `qute://help/` to make sure links
work properly.
- Fixes for the size calculation of pinned tabs in the tab bar.
- Worked around a crash with PyQt 5.9.1 compiled against Qt < 5.9.1 when using
`:yank` or `qute://` URLs.
- Fixed crash when opening `qute://help/img`.
- Fixed `gU` (`:navigate up`) on `qute://help` and webservers not handling `..`
in a URL.
- Using e.g. `-s backend webkit` to set the backend now works correctly.
- Fixed crash when closing the tab an external editor was opened in.
- When using `:search-next` before a search is finished, no warning about no
results being found is shown anymore.
- Fix `:click-element` with an ID containing non-alphanumeric characters.
- Fix crash when a subprocess outputs data which is not decodable as UTF-8.
- Fix crash when closing a tab immediately after hinting.
- Worked around issues in Qt 5.10 with loading progress never being finished.
- Fixed a crash when writing a flag before a command (e.g. `:-w open `).
- Fixed a crash when clicking certain form elements with QtWebEngine.
Deprecated
~~~~~~~~~~
- `:tab-detach` has been deprecated, as `:tab-give` without argument can be used
instead.
Removed
~~~~~~~
- The long-deprecated `:prompt-yes`, `:prompt-no`, `:paste-primary` and `:paste`
commands have been removed.
- The invocation `:download <url> <dest>` which was deprecated in v0.5.0 was
removed, use `:download --dest <dest> <url>` instead.
- The `messages.unfocused` option which wasn't used anymore was removed.
- The `x[xtb]` default bindings got removed again as many users accidentally
triggered them.
v1.0.4
------
Fixed
~~~~~
- The `qute://gpl` page now works correctly again.
- Trying to bind an empty command now doesn't crash anymore.
- Fixed crash when `:config-write-py` fails to write to the given path.
- Fixed crash for some users when selecting a file with Qt 5.9.3
- Improved handling for various SQL errors
- Fix crash when setting content.cache.size to a big value (> 2 GB)
v1.0.3
------
Changed
~~~~~~~
- macOS and Windows builds are now built with PyQt 5.9.1 and Qt 5.9.2, including
various bugfixes, as well as security fixes from Chromium up to version
61.0.3163.79.
- Performance improvements for tab rendering.
- The :open-editor command is now not hidden anymore as it's also usable in
normal mode.
Fixed
~~~~~
- Handle accessing a locked sqlite database gracefully
- Abort pinned tab dialogs properly when a tab is closed e.g. by closing a
window
- Unbinding a default keybinding twice now doesn't bind it again
- Completions are now sorted correctly again when filtered
v1.0.2
------
Fixed
~~~~~
- Fix workaround for black screens or crashes with Nvidia cards
- Handle a filesystem going read-only gracefully
- Fix crash when setting `fonts.monospace`
- Fix list options not being modifyable via `.append()` in `config.py`
- Mark the content.notifications setting as QtWebKit only correctly
- Fix wrong rendering of keys like `<back>` in the completion
Changed
~~~~~~~
- Nicer error messages and other minor improvements
v1.0.1
------
Fixes
Fixed
~~~~~
- Fixed starting after customizing `fonts.tabs` or `fonts.debug_console`.
@@ -56,6 +688,9 @@ Major changes
the entire browsing history. The default for
`completion.web_history_max_items` got changed to `-1` (unlimited). If the
completion is too slow on your machine, try setting it to a few 1000 items.
- Up/Down now navigates through the command history instead of selecting
completion items. Either use Tab to cycle through the completion, or
https://github.com/qutebrowser/qutebrowser/blob/master/doc/help/configuring.asciidoc#migrating-older-configurations[restore the old behavior].
Added
~~~~~
@@ -895,7 +1530,7 @@ Added
- New `:fake-key` command to send a fake keypress to a website or to
qutebrowser.
- New `--mhtml` argument for `:download` to download a page including all
ressources as MHTML file.
resources as MHTML file.
- New option `tabs -> title-alignment` to change the alignment of tab titles.
Changed
@@ -1095,7 +1730,7 @@ Added
- New argument `--no-err-windows` to suppress all error windows.
- New arguments `--top-navigate` and `--bottom-navigate` (`-t`/`-b`) for `:scroll-page` to specify a navigation action (e.g. automatically go to the next page when arriving at the bottom).
- New flag `-d`/`--detach` for `:spawn` to detach the spawned process so it's not closed when qutebrowser is.
- New flag `-v`/`--verbose` for `:spawn` to print informations when the process started/exited successfully.
- New flag `-v`/`--verbose` for `:spawn` to print information when the process started/exited successfully.
- Many new color settings (foreground setting for every background setting).
- New setting `ui -> modal-js-dialog` to use the standard modal dialogs for javascript questions instead of using the statusbar.
- New setting `colors -> webpage.bg` to set the background color to use for websites which don't set one.

View File

@@ -5,6 +5,11 @@ The Compiler <mail@qutebrowser.org>
:data-uri:
:toc:
IMPORTANT: I'm currently (July 2018) more busy than usual until September,
because of exams coming up. Review of non-trivial pull requests will thus be
delayed until then. If you're reading this note after mid-September, please
open an issue.
I `&lt;3` footnote:[Of course, that says `<3` in HTML.] contributors!
This document contains guidelines for contributing to qutebrowser, as well as
@@ -44,8 +49,8 @@ be easy to solve]
If you prefer C++ or Javascript to Python, see the relevant issues which involve
work in those languages:
* https://github.com/qutebrowser/qutebrowser/issues?utf8=%E2%9C%93&q=is%3Aopen%20is%3Aissue%20label%3Ac%2B%2B[C++] (mostly work on Qt, the library behind qutebrowser)
* https://github.com/qutebrowser/qutebrowser/issues?q=is%3Aopen+is%3Aissue+label%3Ajavascript[JavaScript]
* https://github.com/qutebrowser/qutebrowser/issues?q=is%3Aopen+is%3Aissue+label%3A%22language%3A+c%2B%2B%22[C++] (mostly work on Qt, the library behind qutebrowser)
* https://github.com/qutebrowser/qutebrowser/issues?q=is%3Aopen+is%3Aissue+label%3A%22language%3A+javascript%22[JavaScript]
There are also some things to do if you don't want to write code:
@@ -85,6 +90,16 @@ git format-patch origin/master <1>
<1> Replace `master` by the branch your work was based on, e.g.,
`origin/develop`.
Running qutebrowser
-------------------
After link:install.asciidoc#tox[installing qutebrowser via tox], you can run
`.venv/bin/qutebrowser --debug --temp-basedir` to test your changes with debug
logging enabled and without affecting existing running instances.
Alternatively, you can install qutebrowser's dependencies system-wide and run
`python3 -m qutebrowser --debug --temp-basedir`.
Useful utilities
----------------
@@ -100,16 +115,10 @@ Currently, the following tox environments are available:
- `py35`, `py36`: Run pytest for python 3.5/3.6 with the system-wide PyQt.
- `py36-pyqt57`, ..., `py36-pyqt59`: Run pytest with the given PyQt version (`py35-*` also works).
- `py36-pyqt59-cov`: Run with coverage support (other Python/PyQt versions work too).
* `flake8`: Run https://pypi.python.org/pypi/flake8[flake8] checks:
https://pypi.python.org/pypi/pyflakes[pyflakes],
https://pypi.python.org/pypi/pep8[pep8],
https://pypi.python.org/pypi/mccabe[mccabe].
* `flake8`: Run various linting checks via https://pypi.python.org/pypi/flake8[flake8].
* `vulture`: Run https://pypi.python.org/pypi/vulture[vulture] to find
unused code portions.
* `pylint`: Run http://pylint.org/[pylint] static code analysis.
* `pydocstyle`: Check
https://www.python.org/dev/peps/pep-0257/[PEP257] compliance with
https://github.com/PyCQA/pydocstyle[pydocstyle].
* `pyroma`: Check packaging practices with
https://pypi.python.org/pypi/pyroma/[pyroma].
* `eslint`: Run http://eslint.org/[ESLint] javascript checker.
@@ -194,8 +203,8 @@ There are some useful functions for debugging in the `qutebrowser.utils.debug`
module.
When starting qutebrowser with the `--debug` flag, you also get useful debug
logs. You can add +--logfilter _category[,category,...]_+ to restrict logging
to the given categories.
logs. You can add +--logfilter _[!]category[,category,...]_+ to restrict
logging to the given categories.
With `--debug` there are also some additional +debug-_*_+ commands available,
for example `:debug-all-objects` and `:debug-all-widgets` which print a list of
@@ -381,7 +390,7 @@ The following logging levels are available for every logger:
|error |There was an issue and some kind of operation was abandoned.
|warning |There was an issue but the operation can continue running.
|info |General informational messages.
|debug |Verbose debugging informations.
|debug |Verbose debugging information.
|=======================================================================
[[commands]]
@@ -470,7 +479,6 @@ 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.
- `hide=True`: Hide the argument from the documentation.
- `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.
@@ -573,6 +581,23 @@ can be useful for debugging:
- chrome://gpuclean/ (crashes the current renderer process!)
- chrome://ppapiflashcrash/
- chrome://ppapiflashhang/
- chrome://quota-internals/ (Qt 5.11)
- chrome://taskscheduler-internals/ (Qt 5.11)
- chrome://sandbox/ (Qt 5.11, Linux only)
QtWebEngine internals
~~~~~~~~~~~~~~~~~~~~~
This is mostly useful for qutebrowser maintainers to work around issues in Qt - if you don't understand it, don't worry, just ignore it.
The hierarchy of widgets when QtWebEngine is involved looks like this:
- qutebrowser has a `WebEngineTab` object, which is its abstraction over QtWebKit/QtWebEngine.
- The `WebEngineTab` has a `_widget` attribute, which is the https://doc.qt.io/qt-5/qwebengineview.html[QWebEngineView]
- That view has a https://doc.qt.io/qt-5/qwebenginepage.html[QWebEnginePage] for everything which doesn't require rendering.
- The view also has a layout with exactly one element (which also is its `focusProxy()`)
- That element is the http://code.qt.io/cgit/qt/qtwebengine.git/tree/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp[RenderWidgetHostViewQtDelegateWidget] (it inherits https://doc.qt.io/qt-5/qquickwidget.html[QQuickWidget]) - also often referred to as RWHV or RWHVQDW. It can be obtained via `sip.cast(tab._widget.focusProxy(), QQuickWidget)`.
- Calling `rootObject()` on that gives us the https://doc.qt.io/qt-5/qquickitem.html[QQuickItem] where Chromium renders into (?). With it, we can do things like `.setRotation(20)`.
Style conventions
-----------------
@@ -669,19 +694,17 @@ New PyQt release
~~~~~~~~~~~~~~~~
* See above.
* Install new PyQt in Windows VM (32- and 64-bit).
* Download new installer and update PyQt installer path in `ci_install.py`.
* Update `tox.ini`/`.travis.yml`/`.appveyor.yml` to test new versions.
qutebrowser release
~~~~~~~~~~~~~~~~~~~
* Make sure there are no unstaged changes and the tests are green.
* Make sure all issues with the related milestone are closed.
* Run `x=... y=...` to set the respective shell variables.
* Adjust `__version_info__` in `qutebrowser/__init__.py`.
* Update changelog (remove *(unreleased)*).
* Run tests again.
* Adjust `__version_info__` in `qutebrowser/__init__.py`.
* Commit.
* Create annotated git tag (`git tag -s "v1.$x.$y" -m "Release v1.$x.$y"`).
@@ -691,9 +714,11 @@ qutebrowser release
* Mark the milestone at https://github.com/qutebrowser/qutebrowser/milestones
as closed.
* Linux: Run `python3 scripts/dev/build_release.py --upload v1.$x.$y`.
* Windows: Run `C:\Python36-32\python scripts\dev\build_release.py --asciidoc C:\Python27\python C:\asciidoc-8.6.9\asciidoc.py --upload v1.X.Y` (replace X/Y by hand).
* macOS: Run `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).
* Linux: Run `git checkout v1.$x.$y && ./.venv/bin/python3 scripts/dev/build_release.py --upload v1.$x.$y`.
* Windows: Run `git checkout v1.X.Y; py -3.6 scripts\dev\build_release.py --asciidoc C:\Python27\python C:\asciidoc-8.6.9\asciidoc.py --upload v1.X.Y` (replace X/Y by hand).
* macOS: Run `pyenv shell 3.6.6 && 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 `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.

View File

@@ -28,16 +28,20 @@ What's wrong with link:http://portix.bitbucket.org/dwb/[dwb]/link:http://sourcef
https://lists.webkit.org/pipermail/webkit-gtk/2014-March/001821.html[deprecated],
these bugs are never going to be fixed.
+
The newer http://webkitgtk.org/reference/webkit2gtk/stable/index.html[WebKit2
API] seems to lack basic features like proxy support, and almost no projects
seem to have started porting to WebKit2 (I only know of
http://www.uzbl.org/[uzbl]).
When qutebrowser was created, the newer
http://webkitgtk.org/reference/webkit2gtk/stable/index.html[WebKit2 API] lacked
basic features like proxy support, and almost no projects have started porting
to WebKit2. In the meantime, this situation has improved a bit, but there are
still only a few projects which have some kind of WebKit2 support (see the
https://github.com/qutebrowser/qutebrowser#similar-projects[list of
alternatives]).
+
qutebrowser uses http://qt.io/[Qt] and http://wiki.qt.io/QtWebKit[QtWebKit]
instead, which suffers from far less such crashes. It might switch to
http://wiki.qt.io/QtWebEngine[QtWebEngine] in the future, which is based on
Google's https://en.wikipedia.org/wiki/Blink_(layout_engine)[Blink] rendering
engine.
qutebrowser uses http://qt.io/[Qt] and
http://wiki.qt.io/QtWebEngine[QtWebEngine] by default (and supports
http://wiki.qt.io/QtWebKit[QtWebKit] optionally). QtWebEngine is based on
Google's https://www.chromium.org/Home[Chromium]. With an up-to-date Qt, it has
much more man-power behind it than WebKitGTK+ has, and thus supports more modern
web features - it's also arguably more secure.
What's wrong with https://www.mozilla.org/en-US/firefox/new/[Firefox] and link:http://5digits.org/pentadactyl/[Pentadactyl]/link:http://www.vimperator.org/vimperator[Vimperator]?::
Firefox likes to break compatibility with addons on each upgrade, gets
@@ -66,6 +70,31 @@ But isn't Python too slow for a browser?::
and WebKit in C++, with the
https://wiki.python.org/moin/GlobalInterpreterLock[GIL] released.
Is qutebrowser secure?::
Most security issues are in the backend (which handles networking,
rendering, JavaScript, etc.) and not qutebrowser itself.
+
qutebrowser uses http://wiki.qt.io/QtWebEngine[QtWebEngine] by default.
QtWebEngine is based on Google's https://www.chromium.org/Home[Chromium]. While
Qt only updates to a new Chromium release on every minor Qt release (all ~6
months), every patch release backports security fixes from newer Chromium
versions. In other words: As long as you're using an up-to-date Qt, you should
be recieving security updates on a regular basis, without qutebrowser having to
do anything. Chromium's process isolation and
https://chromium.googlesource.com/chromium/src/+/master/docs/design/sandbox.md[sandboxing]
features are also enabled as a second line of defense.
+
http://wiki.qt.io/QtWebKit[QtWebKit] is also supported as an alternative
backend, but hasn't seen new releases
https://github.com/annulen/webkit/releases[in a while]. It also doesn't have any
process isolation or sandboxing.
+
Security issues in qutebrowser's code happen very rarely (as per March 2018,
there has been one security issue caused by qutebrowser in over four years) and
are fixed timely. To report security bugs, please contact me directly at
mail@qutebrowser.org, GPG ID
https://www.the-compiler.org/pubkey.asc[0x916eb0c8fd55a072].
Is there an adblocker?::
There is a host-based adblocker which takes /etc/hosts-like lists. A "real"
adblocker has a
@@ -146,13 +175,13 @@ For QtWebKit:
For QtWebEngine:
. Make sure your versions of PyQt and Qt are 5.8 or higher.
. Use `install_dict.py` script to install dictionaries.
. Use `dictcli.py` script to install dictionaries.
Run the script with `-h` for the parameter description.
. Set `spellcheck.languages` to the desired list of languages, e.g.:
`:set spellcheck.languages "['en-US', 'pl-PL']"`
How do I use Tor with qutebrowser?::
Start tor on your machine, and do `:set network proxy socks://localhost:9050/`
Start tor on your machine, and do `:set content.proxy socks://localhost:9050/`
in qutebrowser. Note this won't give you the same amount of fingerprinting
protection that the Tor Browser does, but it's useful to be able to access
`.onion` sites.
@@ -162,7 +191,7 @@ Why does J move to the next (right) tab, and K to the previous (left) one?::
and qutebrowser's keybindings are designed to be compatible with dwb's.
The rationale behind it is that J is "down" in vim, and K is "up", which
corresponds nicely to "next"/"previous". It also makes much more sense with
vertical tabs (e.g. `:set tabs position left`).
vertical tabs (e.g. `:set tabs.position left`).
What's the difference between insert and passthrough mode?::
They are quite similar, but insert mode has some bindings (like `Ctrl-e` to
@@ -183,13 +212,40 @@ Why takes it longer to open an URL in qutebrowser than in chromium?::
qutebrowser if it is not running already. Also check if you want
to use webengine as backend in line 17 and change it to your
needs.
How do I make qutebrowser use greasemonkey scripts?::
There is currently no UI elements to handle managing greasemonkey scripts.
All management of what scripts are installed or disabled is done in the
filesystem by you. qutebrowser reads all files that have an extension of
`.js` from the `<data>/greasemonkey/` folder and attempts to load them.
Where `<data>` is the qutebrowser data directory shown in the `Paths`
section of the page displayed by `:version`. If you want to disable a
script just rename it, for example, to have `.disabled` on the end, after
the `.js` extension. To reload scripts from that directory run the command
`:greasemonkey-reload`.
+
Troubleshooting: to check that your script is being loaded when
`:greasemonkey-reload` runs you can start qutebrowser with the arguments
`--debug --logfilter greasemonkey,js` and check the messages on the
program's standard output for errors parsing or loading your script.
You may also see javascript errors if your script is expecting an environment
that we fail to provide.
+
Note that there are some missing features which you may run into:
. Some scripts expect `GM_xmlhttpRequest` to ignore Cross Origin Resource
Sharing restrictions, this is currently not supported, so scripts making
requests to third party sites will often fail to function correctly.
. If your backend is a QtWebEngine version 5.8, 5.9 or 5.10 then regular
expressions are not supported in `@include` or `@exclude` rules. If your
script uses them you can re-write them to use glob expressions or convert
them to `@match` rules.
See https://wiki.greasespot.net/Metadata_Block[the wiki] for more info.
. Any greasemonkey API function to do with adding UI elements is not currently
supported. That means context menu extentensions and background pages.
== Troubleshooting
Configuration not saved after modifying config.::
When editing your config file manually, qutebrowser must be exited completely.
This can be done by issuing the command `:quit` or by pressing `Ctrl+q`.
Unable to view flash content.::
If you have flash installed for on your system, it's necessary to enable plugins
to use the flash plugin. Using the command `:set content.plugins true`
@@ -216,10 +272,33 @@ And then re-emerging qtwebengine with: +
emerge -1 qtwebengine
Unable to view DRM content (Netflix, Spotify, etc.).::
You will need to install `widevine` and set `qt.args` to point to it.
Qt 5.9 currently only supports widevine up to Chrome version 61.
+
On Arch, simply install `qt5-webengine-widevine` from the AUR and run:
+
----
:set qt.args '["ppapi-widevine-path=/usr/lib/qt/plugins/ppapi/libwidevinecdmadapter.so"]'
:restart
----
+
For other distributions, download the chromium tarball and widevine-cdm zip from
https://aur.archlinux.org/packages/qt5-webengine-widevine/[the AUR page],
extract `libwidevinecdmadapter.so` and `libwidevinecdm.so` files, respectively,
and move them to the `ppapi` plugin directory in your Qt library directory (create it if it does not exist).
+
Lastly, set your `qt.args` to point to that directory and restart qutebrowser:
+
----
:set qt.args '["ppapi-widevine-path=/usr/lib64/qt5/plugins/ppapi/libwidevinecdmadapter.so"]'
:restart
----
My issue is not listed.::
If you experience any segfaults or crashes, you can report the issue in
https://github.com/qutebrowser/qutebrowser/issues[the issue tracker] or
using the `:report` command.
If you are reporting a segfault, make sure you read the
link:doc/stacktrace.asciidoc[guide] on how to report them with all needed
link:stacktrace.asciidoc[guide] on how to report them with all needed
information.

File diff suppressed because it is too large Load Diff

View File

@@ -3,34 +3,28 @@ Configuring qutebrowser
IMPORTANT: qutebrowser's configuration system was completely rewritten in
September 2017. This information is not applicable to older releases, and older
information elsewhere might be outdated. **If you had an old configuration
around and upgraded, this page will automatically open once**. To view it at a
later time, use the `:help` command.
information elsewhere might be outdated.
Migrating older configurations
------------------------------
qutebrowser's config files
--------------------------
qutebrowser does no automatic migration for the new configuration. However,
there's a special link:qute://configdiff/old[configdiff] page in qutebrowser,
which will show you the changes you did in your old configuration, compared to
the old defaults.
qutebrowser releases before v1.0.0 had a `qutebrowser.conf` and `keys.conf`
file. Those are not used anymore since that release - see
<<migrating,"Migrating older configurations">> for information on how to
migrate to the new config.
Other changes in default settings:
When using `:set` and `:bind`, changes are saved to an `autoconfig.yml` file
automatically. If you don't want to have a config file which is curated by
hand, you can simply use those - see
<<autoconfig,"Configuring qutebrowser via the user interface">> for details.
- `<Up>` and `<Down>` in the completion now navigate through command history
instead of selecting completion items. You can get back the old behavior by
doing:
+
----
:bind -f -m command <Up> completion-item-focus prev
:bind -f -m command <Down> completion-item-focus next
----
- The default for `completion.web_history_max_items` is now set to `-1`, showing
an unlimited number of items in the completion for `:open` as the new
sqlite-based completion is much faster. If the `:open` completion is too slow
on your machine, set an appropriate limit again.
For more advanced configuration, you can write a `config.py` file - see
<<configpy,"Configuring qutebrowser via config.py">>. As soon as a `config.py`
exists, the `autoconfig.yml` file **is not read anymore** by default. You need
to <<configpy-autoconfig,load it by hand>> if you want settings done via
`:set`/`:bind` to still persist.
[[autoconfig]]
Configuring qutebrowser via the user interface
----------------------------------------------
@@ -53,6 +47,10 @@ customizable.
Using the link:commands.html#set[`:set`] command and command completion, you
can quickly set settings interactively, for example `:set tabs.position left`.
Some settings are also customizable for a given
https://developer.chrome.com/apps/match_patterns[URL pattern] by doing e.g.
`:set --pattern=*://example.com/ content.images false`.
To get more help about a setting, use e.g. `:help tabs.position`.
To bind and unbind keys, you can use the link:commands.html#bind[`:bind`] and
@@ -74,6 +72,7 @@ link:commands.html#config-clear[`:config-clear`] to reset the entire configurati
and link:commands.html#config-cycle[`:config-cycle`] to cycle a setting between
different values.
[[configpy]]
Configuring qutebrowser via config.py
-------------------------------------
@@ -137,7 +136,6 @@ prefix to preserve backslashes) or a Python regex object:
If you want to read a setting, you can use the `c` object to do so as well:
`c.colors.tabs.even.bg = c.colors.tabs.odd.bg`.
Using strings for setting names
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -161,6 +159,26 @@ To read a setting, use the `config.get` method:
color = config.get('colors.completion.fg')
----
Per-domain settings
~~~~~~~~~~~~~~~~~~~
Using `config.set`, some settings are also customizable for a given
https://developer.chrome.com/apps/match_patterns[URL pattern]:
[source,python]
----
config.set('content.images', False, '*://example.com/')
----
Alternatively, you can use `with config.pattern(...) as p:` to get a shortcut
similar to `c.` which is scoped to the given domain:
[source,python]
----
with config.pattern('*://example.com/') as p:
p.content.images = False
----
Binding keys
~~~~~~~~~~~~
@@ -206,13 +224,14 @@ config.bind(',v', 'spawn mpv {url}')
To suppress loading of any default keybindings, you can set
`c.bindings.default = {}`.
[[configpy-autoconfig]]
Loading `autoconfig.yml`
~~~~~~~~~~~~~~~~~~~~~~~~
By default, all customization done via `:set`, `:bind` and `:unbind` is
temporary as soon as a `config.py` exists. The settings done that way are always
saved in the `autoconfig.yml` file, but you'll need to explicitly load it in
your `config.py` by doing:
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:
.config.py:
[source,python]
@@ -237,11 +256,14 @@ that via `import utils` as well.
While it's in some cases possible to import code from the qutebrowser
installation, doing so is unsupported and discouraged.
To read config data from a different file with `c` and `config` available, you
can use `config.source('otherfile.py')` in your `config.py`.
Getting the config directory
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you need to get the qutebrowser config directory, you can do so by reading
`config.configdir`. Similarily, you can get the qutebrowser data directory via
`config.configdir`. Similarly, you can get the qutebrowser data directory via
`config.datadir`.
This gives you a https://docs.python.org/3/library/pathlib.html[`pathlib.Path`
@@ -251,7 +273,7 @@ get a string:
.config.py:
[source,python]
----
print(str(config.configdir / 'config.py')
print(str(config.configdir / 'config.py'))
----
Handling errors
@@ -346,15 +368,46 @@ def bind_chained(key, *commands):
bind_chained('<Escape>', 'clear-keychain', 'search')
----
Avoiding flake8 errors
^^^^^^^^^^^^^^^^^^^^^^
Reading colors from Xresources
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you use an editor with flake8 integration which complains about `c` and `config` being undefined, you can use:
You can use something like this to read colors from an `~/.Xresources` file:
[source,python]
----
c = c # noqa: F821
config = config # noqa: F821
import subprocess
def read_xresources(prefix):
props = {}
x = subprocess.run(['xrdb', '-query'], stdout=subprocess.PIPE)
lines = x.stdout.decode().split('\n')
for line in filter(lambda l : l.startswith(prefix), lines):
prop, _, value = line.partition(':\t')
props[prop] = value
return props
xresources = read_xresources('*')
c.colors.statusbar.normal.bg = xresources['*.background']
----
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]
Avoiding flake8 errors
^^^^^^^^^^^^^^^^^^^^^^
If you use an editor with flake8 and pylint integration, it may have some
complaints about invalid names, undefined variables, or missing docstrings.
You can silence those with:
[source,python]
----
# pylint: disable=C0111
c = c # noqa: F821 pylint: disable=E0602,C0103
config = config # noqa: F821 pylint: disable=E0602,C0103
----
For type annotation support (note that those imports aren't guaranteed to be
@@ -362,8 +415,44 @@ stable across qutebrowser versions):
[source,python]
----
# pylint: disable=C0111
from qutebrowser.config.configfiles import ConfigAPI # noqa: F401
from qutebrowser.config.config import ConfigContainer # noqa: F401
config = config # type: ConfigAPI # noqa: F821
c = c # type: ConfigContainer # noqa: F821
config = config # type: ConfigAPI # noqa: F821 pylint: disable=E0602,C0103
c = c # type: ConfigContainer # noqa: F821 pylint: disable=E0602,C0103
----
[[migrating]]
Migrating older configurations
------------------------------
qutebrowser does no automatic migration for the new configuration. However,
there's a special link:qute://configdiff/old[configdiff] page
(`qute://configdiff/old`) in qutebrowser, which will show you the changes you
did in your old configuration, compared to the old defaults.
Other changes in default settings:
- In v1.1.x and newer, `<Up>` and `<Down>` navigate through command history
if no text was entered yet.
With v1.0.x, they always navigate through command history instead of selecting
completion items. Use `<Tab>`/`<Shift-Tab>` to cycle through the completion
instead.
You can get back the old behavior by doing:
+
----
:bind -m command <Up> completion-item-focus prev
:bind -m command <Down> completion-item-focus next
----
+
or always navigate through command history with
+
----
:bind -m command <Up> command-history-prev
:bind -m command <Down> command-history-next
----
- The default for `completion.web_history_max_items` is now set to `-1`, showing
an unlimited number of items in the completion for `:open` as the new
sqlite-based completion is much faster. If the `:open` completion is too slow
on your machine, set an appropriate limit again.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 989 KiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -21,7 +21,7 @@ Those distributions only have Python 3.4 and a too old Qt version available,
while qutebrowser requires Python 3.5 and Qt 5.7.1 or newer.
It should be possible to install Python 3.5 e.g. from the
https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa[deadsnakes PPA] or via_ipca
https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa[deadsnakes PPA] or via
https://github.com/pyenv/pyenv[pyenv], but nobody tried that yet.
If you get qutebrowser running on those distributions, please
@@ -35,30 +35,51 @@ Ubuntu 16.04 doesn't come with an up-to-date engine (a new enough QtWebKit, or
QtWebEngine). However, it comes with Python 3.5, so you can
<<tox,install qutebrowser via tox>>.
Debian Stretch / Ubuntu 17.04 and newer
You'll need some basic libraries to use the tox-installed PyQt:
----
# apt install libglib2.0-0 libgl1 libfontconfig1 libx11-xcb1 libxi6 libxrender1 libdbus-1-3
----
Debian Stretch / Ubuntu 17.04 and 17.10
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Those versions come with QtWebEngine in the repositories. This makes it possible
to install qutebrowser via the Debian package.
Install the dependencies via apt-get:
You'll need to download three packages:
- https://packages.debian.org/sid/all/python3-pypeg2/download[PyPEG2] (a library
used by qutebrowser which is not in the earlier repositories)
- https://packages.debian.org/sid/all/qutebrowser/download[qutebrowser] itself
- Either https://packages.debian.org/sid/all/qutebrowser-qtwebengine/download[qutebrowser-qtwebengine]
or https://packages.debian.org/sid/all/qutebrowser-qtwebkit/download[qutebrowser-qtwebkit]
(or both) depending on the backend you want to use. QtWebEngine is the
default/recommended choice.
After downloading, install the packages (make sure to install all the
downloaded qutebrowser deb files in one apt command):
----
# apt install python-tox python3-{lxml,pyqt5,sip,jinja2,pygments,yaml,attr} python3-pyqt5.qt{webengine,quick,opengl,sql} libqt5sql5-sqlite
# apt install ./python3-pypeg2_*_all.deb
# apt install ./qutebrowser*.deb
----
Get the qutebrowser package from the
https://github.com/qutebrowser/qutebrowser/releases[release page] and download
the https://qutebrowser.org/python3-pypeg2_2.15.2-1_all.deb[PyPEG2 package].
For an update after the initial install, you only need to download/install the
qutebrowser package.
Install the packages:
Debian Testing / Ubuntu 18.04
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On Debian Testing, qutebrowser is in the official repositories, and you can
install it with apt:
----
# dpkg -i python3-pypeg2_*_all.deb
# dpkg -i qutebrowser_*_all.deb
# apt install qutebrowser
----
Some additional hints:
Additional hints
~~~~~~~~~~~~~~~~
- Alternatively, you can <<tox,install qutebrowser via tox>> to get a newer
QtWebEngine version.
@@ -66,31 +87,44 @@ Some additional hints:
`:help` command:
+
----
# apt-get install --no-install-recommends asciidoc source-highlight
# apt install --no-install-recommends asciidoc source-highlight
$ python3 scripts/asciidoc2html.py
----
- If you prefer using QtWebKit, there's an up-to-date version available in
Debian experimental, or from http://repo.paretje.be/unstable/[this repository]
for Debian Stretch.
https://packages.debian.org/buster/libqt5webkit5[Debian Testing].
- If video or sound don't work with QtWebKit, try installing the gstreamer plugins:
+
----
# apt-get install gstreamer1.0-plugins-{bad,base,good,ugly}
# apt install gstreamer1.0-plugins-{bad,base,good,ugly}
----
On Fedora
---------
qutebrowser is available in the official repositories for Fedora 22 and newer.
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
----
-----
It's also recommended to install `python3-qt5-webengine` and start with `--backend
webengine` to use the new backend. v1.0.0 (which is not in the Fedora repos
currently) uses QtWebEngine by default.
However, note that Fedora 25/26 won't be updated to qutebrowser v1.0, so you
might want to <<tox,install qutebrowser via tox>> instead there.
Additional hints
~~~~~~~~~~~~~~~~
Fedora only ships free software in the repositories.
To be able to play videos with proprietary codecs with QtWebEngine, you will
need to install an additional package from the RPM Fusion Free repository.
For more information see https://rpmfusion.org/Configuration.
-----
# dnf install qt5-qtwebengine-freeworld
-----
On Archlinux
------------
@@ -125,14 +159,16 @@ If video or sound don't work with QtWebKit, try installing the gstreamer plugins
On Gentoo
---------
The Gentoo packages (even the live version) are lagging behind a lot and are
effectively unmaintained. If you want to create and maintain an official
qutebrowser overlay for Gentoo, please mailto:mail@qutebrowser.org[get in
touch.]
NOTE: Gentoo's packages used to be severely outdated for a long time, but are
now (October 2017) maintained and up-to-date again.
It's recommended to <<tox,install qutebrowser via tox>> instead.
qutebrowser is available in the main repository and can be installed with:
To get an up-to-date QtWebKit, you can use
----
# emerge -av qutebrowser
----
To use QtWebKit instead of QtWebEngine, you'll need a newer QtWebKit using
https://gist.github.com/annulen/309569fb61e5d64a703c055c1e726f71[this ebuild].
If video or sound don't work with QtWebKit, try installing the gstreamer
@@ -189,6 +225,10 @@ To use the QtWebEngine backend, install `libqt5-qtwebengine`.
On OpenBSD
----------
WARNING: OpenBSD only packages a legacy unmaintained version of QtWebKit (for
which support was dropped in qutebrowser v1.0). It's advised to not use
qutebrowser from OpenBSD ports for untrusted websites.
qutebrowser is in http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/www/qutebrowser/[OpenBSD ports].
Install the package:
@@ -204,6 +244,21 @@ Or alternatively, use the ports system :
# make install
----
On FreeBSD
----------
qutebrowser is in https://www.freshports.org/www/qutebrowser/[FreeBSD ports].
It can be installed with:
----
# cd /usr/ports/www/qutebrowser
# make install clean
----
At present, precompiled packages are not available for this port,
and QtWebEngine backend is also not available.
On Windows
----------
@@ -221,6 +276,10 @@ https://lists.schokokeks.org/mailman/listinfo.cgi/qutebrowser-announce[qutebrows
mailinglist] to get notified on new releases). You can install a newer version
without uninstalling the older one.
The binary release ships with a QtWebEngine built without proprietary codec
support. To get support for e.g. h264/h265 videos, you'll need to build
QtWebEngine from source yourself with support for that enabled.
https://chocolatey.org/packages/qutebrowser[Chocolatey package]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -232,6 +291,11 @@ PS C:\> Install-Package qutebrowser
----
C:\> choco install qutebrowser
----
* Scoop's client
----
C:\> scoop bucket add extras
C:\> scoop install qutebrowser
----
Manual install
~~~~~~~~~~~~~~
@@ -261,6 +325,10 @@ Note that you'll need to upgrade to new versions manually (subscribe to the
https://lists.schokokeks.org/mailman/listinfo.cgi/qutebrowser-announce[qutebrowser-announce
mailinglist] to get notified on new releases).
The binary release ships with a QtWebEngine built without proprietary codec
support. To get support for e.g. h264/h265 videos, you'll need to build
QtWebEngine from source yourself with support for that enabled.
This binary is also available through the
https://caskroom.github.io/[Homebrew Cask] package manager:
@@ -314,8 +382,8 @@ $ git clone https://github.com/qutebrowser/qutebrowser.git
$ cd qutebrowser
----
Installing depdendencies (including Qt)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Installing dependencies (including Qt)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Then run tox inside the qutebrowser repository to set up a
https://docs.python.org/3/library/venv.html[virtual environment]:
@@ -324,6 +392,10 @@ https://docs.python.org/3/library/venv.html[virtual environment]:
$ tox -e mkvenv-pypi
----
If your system comes with Python 3.5.3 or older (such as Ubuntu 16.04 LTS), use
`tox -e mkvenv-pypi-old` instead. This installs an older Qt version (5.10) due
to bugs in newer versions.
This installs all needed Python dependencies in a `.venv` subfolder.
This comes with an up-to-date Qt/PyQt including QtWebEngine, but has a few
@@ -352,20 +424,39 @@ local Qt install instead of installing PyQt in the virtualenv. However, unless
you have a new QtWebKit or QtWebEngine available, qutebrowser will not work. It
also typically means you'll be using an older release of QtWebEngine.
On Windows, run `tox -e 'mkvenv-win' instead, however make sure that ONLY
Python3 is in your PATH before running tox.
On Windows, run `set PYTHON=C:\path\to\python.exe` (CMD) or ``$Env:PYTHON =
"..."` (Powershell) first.
Creating a wrapper script
~~~~~~~~~~~~~~~~~~~~~~~~~
You can then create a simple wrapper script to start qutebrowser somewhere in
your `$PATH` (e.g. `/usr/local/bin/qutebrowser` or `~/bin/qutebrowser`):
Running `tox` does not install a system-wide `qutebrowser` script. You can
launch qutebrowser by doing:
----
.venv/bin/python3 -m qutebrowser
----
You can create a simple wrapper script to start qutebrowser somewhere in your
`$PATH` (e.g. `/usr/local/bin/qutebrowser` or `~/bin/qutebrowser`):
----
#!/bin/bash
~/path/to/qutebrowser/.venv/bin/python3 -m qutebrowser "$@"
----
Building the docs
~~~~~~~~~~~~~~~~~
To build the documentation, install `asciidoc` (note that LaTeX which comes as
optional/recommended dependency with some distributions is not required).
Then, run:
----
$ python3 scripts/asciidoc2html.py
----
Updating
~~~~~~~~

View File

@@ -22,9 +22,9 @@ Basic keybindings to get you started
What to do now
--------------
* View the link:http://qutebrowser.org/img/cheatsheet-big.png[key binding cheatsheet]
* View the link:https://raw.githubusercontent.com/qutebrowser/qutebrowser/master/doc/img/cheatsheet-big.png[key binding cheatsheet]
to make yourself familiar with the key bindings: +
image:http://qutebrowser.org/img/cheatsheet-small.png["qutebrowser key binding cheatsheet",link="http://qutebrowser.org/img/cheatsheet-big.png"]
image:https://raw.githubusercontent.com/qutebrowser/qutebrowser/master/doc/img/cheatsheet-small.png["qutebrowser key binding cheatsheet",link="https://raw.githubusercontent.com/qutebrowser/qutebrowser/master/doc/img/cheatsheet-big.png"]
* There's also a https://www.shortcutfoo.com/app/dojos/qutebrowser[free training
course] on shortcutfoo for the keybindings - note that you need to be in
insert mode (i) for it to work.

View File

@@ -38,7 +38,7 @@ show it.
*-h*, *--help*::
show this help message and exit
*--basedir* 'BASEDIR'::
*-B* 'BASEDIR', *--basedir* 'BASEDIR'::
Base directory for all storage.
*-V*, *--version*::
@@ -60,7 +60,7 @@ show it.
Which backend to use.
*--enable-webengine-inspector*::
Enable the web inspector for QtWebEngine. Note that this is a SECURITY RISK and you should not visit untrusted websites with the inspector turned on. See https://bugreports.qt.io/browse/QTBUG-50725 for more details.
Enable the web inspector for QtWebEngine. Note that this is a SECURITY RISK and you should not visit untrusted websites with the inspector turned on. See https://bugreports.qt.io/browse/QTBUG-50725 for more details. This is not needed anymore since Qt 5.11 where the inspector is always enabled and secure.
=== debug arguments
*-l* '{critical,error,warning,info,debug,vdebug}', *--loglevel* '{critical,error,warning,info,debug,vdebug}'::
@@ -72,7 +72,7 @@ show it.
*--loglines* 'LOGLINES'::
How many lines of the debug log to keep in RAM (-1: unlimited).
*--debug*::
*-d*, *--debug*::
Turn on debugging options.
*--json-logging*::
@@ -87,7 +87,7 @@ show it.
*--nowindow*::
Don't show the main window.
*--temp-basedir*::
*-T*, *--temp-basedir*::
Use a temporary basedir.
*--no-err-windows*::
@@ -99,7 +99,7 @@ show it.
*--qt-flag* 'QT_FLAG'::
Pass an argument to Qt as flag.
*--debug-flag* 'DEBUG_FLAGS'::
*-D* 'DEBUG_FLAGS', *--debug-flag* 'DEBUG_FLAGS'::
Pass name of debugging feature to be turned on.
// QUTE_OPTIONS_END

View File

@@ -37,7 +37,7 @@ is available in the repositories:
Archlinux
^^^^^^^^^
For Archlinux, no debug informations are provided. You can either compile Qt
For Archlinux, no debug information is provided. You can either compile Qt
yourself (which will take a few hours even on a modern machine) or use
debugging symbols compiled/packaged by me (x86_64 only).
@@ -57,7 +57,7 @@ Then edit your `/etc/pacman.conf` to add the repository to the bottom:
----
[qt-debug]
Server = http://qutebrowser.org/qt-debug/$arch
Server = https://qutebrowser.org/qt-debug/$arch
----
Then install the packages:

View File

@@ -31,7 +31,7 @@ The following environment variables will be set when a userscript is launched:
- `QUTE_MODE`: Either `hints` (started via hints) or `command` (started via
command or key binding).
- `QUTE_USER_AGENT`: The currently set user agent.
- `QUTE_USER_AGENT`: The currently set user agent, if customized.
- `QUTE_FIFO`: The FIFO or file to write commands to.
- `QUTE_HTML`: Path of a file containing the HTML source of the current page.
- `QUTE_TEXT`: Path of a file containing the plaintext of the current page.
@@ -45,8 +45,6 @@ In `command` mode:
- `QUTE_URL`: The current URL.
- `QUTE_TITLE`: The title of the current page.
- `QUTE_SELECTED_TEXT`: The text currently selected on the page.
- `QUTE_SELECTED_HTML` The HTML currently selected on the page (not supported
with QtWebEngine).
In `hints` mode:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 113 KiB

View File

@@ -1,207 +1,302 @@
/* XPM */
static char *qutebrowser[] = {
/* columns rows colors chars-per-pixel */
"32 32 169 2 ",
" c #0A396E",
". c #0B3C72",
"X c #0B4077",
"o c #0C437B",
"O c #134175",
"+ c #15467C",
"@ c #18477B",
"# c #1A497D",
"$ c #0D4B86",
"% c #0F4E8D",
"& c #124A80",
"* c #1F4F83",
"= c #0E518C",
"- c #1F5084",
"; c #11508C",
": c #0F5193",
"> c #115799",
", c #115B9C",
"< c #204F83",
"1 c #245287",
"2 c #2A598C",
"3 c #325E8F",
"4 c #11609F",
"5 c #346496",
"6 c #3B6898",
"7 c #115CA1",
"8 c #115EAC",
"9 c #1263A3",
"0 c #1260AD",
"q c #136BAC",
"w c #136BB2",
"e c #1366BA",
"r c #196BB2",
"t c #157ABB",
"y c #1577BB",
"u c #2E6DB0",
"i c #387FB1",
"p c #456E9A",
"a c #4873A1",
"s c #4375AA",
"d c #507AA6",
"f c #597EA4",
"g c #4D7EB3",
"h c #156FCB",
"j c #167AC5",
"k c #1675CA",
"l c #177BCE",
"z c #1777D8",
"x c #1476E4",
"c c #167BE6",
"v c #167DE8",
"b c #197EEF",
"n c #1A7FF0",
"m c #1A80BE",
"M c #5F87AF",
"N c #5D8BBA",
"B c #5A84B1",
"V c #6C8FB3",
"C c #6F96BE",
"Z c #1886CC",
"A c #1883D7",
"S c #198DD5",
"D c #1987D9",
"F c #198ADC",
"G c #1A96DC",
"H c #3090D9",
"J c #1682E9",
"K c #1983ED",
"L c #1689E9",
"P c #1A8DEE",
"I c #1B95ED",
"U c #1C9EEA",
"Y c #1B97E4",
"T c #1A84F2",
"R c #1A8BF2",
"E c #1C94F4",
"W c #1D9CF5",
"Q c #3388E6",
"! c #3D90E9",
"~ c #228EF3",
"^ c #229FF6",
"/ c #3294F4",
"( c #3D9FF6",
") c #339CF4",
"_ c #1CA2E5",
"` c #1DABEE",
"' c #1DA4F6",
"] c #1EA9F7",
"[ c #1EADF8",
"{ c #1FB4F9",
"} c #1FB9FA",
"| c #20ACF8",
" . c #27A4F6",
".. c #3DA9F6",
"X. c #20B9FA",
"o. c #2EB6F9",
"O. c #458DC9",
"+. c #5C8DC1",
"@. c #5795C6",
"#. c #709DCB",
"$. c #74A8DD",
"%. c #4A97EA",
"&. c #4896EA",
"*. c #559EEA",
"=. c #439AF5",
"-. c #46A3F6",
";. c #5FA9F6",
":. c #5EA6F3",
">. c #47BCF9",
",. c #51B5F8",
"<. c #58BDF8",
"1. c #68ABEF",
"2. c #7DB9E7",
"3. c #63AEF7",
"4. c #6FB1F7",
"5. c #66B9F8",
"6. c #61B2F6",
"7. c #71B4F7",
"8. c #78B7F4",
"9. c #72BFF9",
"0. c #3BC0FA",
"q. c #6FCEFB",
"w. c #6CC5FA",
"e. c #7BCAF9",
"r. c #89A7C3",
"t. c #83A2C1",
"y. c #98B6D3",
"u. c #9DB9D3",
"i. c #89B6E4",
"p. c #83B6E9",
"a. c #81BDF7",
"s. c #83BFF8",
"d. c #9EC4E9",
"f. c #8CC2F9",
"g. c #85CDFB",
"h. c #87C4F9",
"j. c #92C6F9",
"k. c #95CAFA",
"l. c #9CCBFA",
"z. c #89D7FC",
"x. c #91D9FC",
"c. c #9CDEFD",
"v. c #9ED2FB",
"b. c #A7CAEC",
"n. c #B5CEE3",
"m. c #A1CEFA",
"M. c #AED0F0",
"N. c #ACD6FA",
"B. c #A0DFFC",
"V. c #AFD8FC",
"C. c #B5D9FB",
"Z. c #BCDDFC",
"A. c #BFDCF5",
"S. c #ACE3FD",
"D. c #B5E5FE",
"F. c #BBE2FC",
"G. c #CFE5F5",
"H. c #C3E1FC",
"J. c #CAE6FD",
"K. c #CCEBFD",
"L. c #C4EBFE",
"P. c #D6EDFE",
"I. c #DAEEFD",
"U. c #DEF1FE",
"Y. c #D6F2FE",
"T. c #E4F4FE",
"R. c #E9F6FE",
"E. c #EBF8FF",
"W. c None",
/* pixels */
"W.W.W.W.W.W.W.W.W.W.W.c.S.L.Y.E.E.S.X.} W.W.W.W.W.W.W.W.W.W.W.W.",
"W.W.W.W.W.W.W.W.W.D.T.E.E.T.L.D.c.z.} } X.} } W.W.W.W.W.W.W.W.W.",
"W.W.W.W.W.W.W.B.T.T.R.T.R.U.0.X.z.S.} } } } { { X.W.W.W.W.W.W.W.",
"W.W.W.W.W.W.x.x.K.T.T.T.L.P.q.o.{ } } ` _ { { { { { W.W.W.W.W.W.",
"W.W.W.W.W.c.P.D.G.u.r.i 9 Z _ { { G 4 X t { { { { { { W.W.W.W.W.",
"W.W.W.W.K.U.n.f O { = t { { { { [ { { W.W.W.W.",
"W.W.W.F.I.t.. ' t { { [ [ [ [ [ >.W.W.W.",
"W.W.x.P.V ' X t ` [ [ [ [ [ [ o.e.W.W.",
"W.W.J.y. X t S Y Z $ ' . y [ [ [ ] [ [ | Z.J.W.W.",
"W.<.e.& , _ ] ] [ ] U . ' . y [ ' [ ] ] ] w.K.J.g.W.",
"W.' S o ' ' [ ' [ ' ] o ' . y Y 9 = = 9 @.J.J.J.F.W.",
"W.| , j ' ' ' ' ' ' ' o ' . $ p A.J.J.g.",
"' .. G ' ' ' ' ' ' ' o ' . M H.H.h.",
",.2. . W ' W ' ' ' ' W . ' . M.A.x.",
"N.M.. . W W W ' W W W W .w 9 I U 0 #.Z.m.",
" .9.O D W W W W ' W j $ % F W W W .5 d Z.C.",
"W W ; 9 9.h.5...Q % o j W W W W W W O. 3 C.N.",
"E W 7 B b.d.a . w E E W W W E W E A @ C.l.",
"I E l u W E W E W E E E E A . - k.6.",
"P E E 7 m.o E E E E E E E E l . = E P ",
"L E E E > . O s.o E E E E E E E E 7 , E L ",
"W.R E R ) #.5 1 6 N i.2 s.+ E E E E E E R L . k R W.",
"W.L R E -.m.m.m.m.m.m.2 m.@ N m.m.s.( R R % X E J W.",
"W.W.K R ~ a.m.l.l.l.l.2 s.+ < i.l.m.j.h % e K W.W.",
"W.W.J R R / l.l.l.l.k.2 s.+ * 5 + 8 R J W.W.",
"W.W.W.v T R 3.k.k.j.k.2 2 j.& . 8 R v W.W.W.",
"W.W.W.W.J T ~ 7.j.j.j.g +.p.j.s.+. . . : z T v W.W.W.W.",
"W.W.W.W.W.c T T =.f.j.j.s.j.j.j.j.$.g s u e h b T T v W.W.W.W.W.",
"W.W.W.W.W.W.c b n 4.f.f.s.m.s.s.s.j.s.j./ T n T b c W.W.W.W.W.W.",
"W.W.W.W.W.W.W.c x 1.s.s.s.s.s.s.s.s.4.=.n T n c c W.W.W.W.W.W.W.",
"W.W.W.W.W.W.W.W.W.&.*.1.a.s.s.s.s.3.n n v x x W.W.W.W.W.W.W.W.W.",
"W.W.W.W.W.W.W.W.W.W.W.%.%.%.%.*.*.Q x x x W.W.W.W.W.W.W.W.W.W.W."
};
static char * qutebrowser_xpm[] = {
"32 32 267 2",
" c None",
". c #9FD4FD",
"+ c #99CBFE",
"@ c #90C3FE",
"# c #89BFFE",
"$ c #81BCFF",
"% c #80BBFF",
"& c #9BCAFD",
"* c #A9DBFB",
"= c #88D3FB",
"- c #98CBFE",
"; c #81BBFF",
"> c #7EBAFF",
", c #84BDFF",
"' c #8DC2FF",
") c #96C7FE",
"! c #A0CCFE",
"~ c #A9D1FE",
"{ c #CEE5FD",
"] c #C7E3FC",
"^ c #8AD3FB",
"/ c #9DCFFD",
"( c #C3DFFD",
"_ c #CDE4FD",
": c #A3CEFE",
"< c #94C6FE",
"[ c #CAE5FC",
"} c #7DD0FB",
"| c #9ECDFD",
"1 c #A1CDFE",
"2 c #8BC1FF",
"3 c #87BFFF",
"4 c #ADD4FE",
"5 c #C6E1FD",
"6 c #CCE3FC",
"7 c #A7DAFB",
"8 c #9DCBFE",
"9 c #78AFF1",
"0 c #6096D4",
"a c #4B82C0",
"b c #5A84B3",
"c c #6589B1",
"d c #6F92B9",
"e c #90AED0",
"f c #C4DBF5",
"g c #6286AE",
"h c #7D9EC2",
"i c #BADFFC",
"j c #85BDFE",
"k c #78B4F8",
"l c #4C83C0",
"m c #1E4F87",
"n c #0A396E",
"o c #345D8D",
"p c #CDE4FC",
"q c #88A7CA",
"r c #1D497C",
"s c #799BBF",
"t c #8AC1FD",
"u c #5E97D7",
"v c #14457B",
"w c #4F76A0",
"x c #A9D5FC",
"y c #95C9FD",
"z c #4C82C1",
"A c #0A3A6F",
"B c #C9E3FD",
"C c #95CCFC",
"D c #629BDB",
"E c #0B3A6F",
"F c #0C3B6F",
"G c #4E749F",
"H c #8CACCE",
"I c #6185AD",
"J c #CBE4FD",
"K c #89C0FF",
"L c #98CDFA",
"M c #27558A",
"N c #144175",
"O c #9BB8D8",
"P c #335D8C",
"Q c #AFC9E6",
"R c #AFD4FE",
"S c #91C7FD",
"T c #A0C0DE",
"U c #194779",
"V c #80A1C5",
"W c #C8E1F9",
"X c #9CB9D8",
"Y c #7799BE",
"Z c #6489B0",
"` c #7092B9",
" . c #6E9DCF",
".. c #79B5F9",
"+. c #83BDFE",
"@. c #7395BA",
"#. c #315C8B",
"$. c #7C9EC2",
"%. c #C0D9F3",
"&. c #7294BA",
"*. c #5C94D4",
"=. c #91CCFC",
"-. c #88CBFA",
";. c #5179A3",
">. c #6E91B7",
",. c #6084AC",
"'. c #96B3D4",
"). c #275283",
"!. c #0C3C71",
"~. c #629CDC",
"{. c #94C6FD",
"]. c #A7D2FC",
"^. c #36659A",
"/. c #2C5788",
"(. c #9DBAD9",
"_. c #B4CEEA",
":. c #476E9A",
"<. c #7EB9FE",
"[. c #8DC3FD",
"}. c #8CC2FE",
"|. c #2F619B",
"1. c #87A6C9",
"2. c #7A9BC0",
"3. c #CBE2FB",
"4. c #C7DFF8",
"5. c #6C8FB5",
"6. c #113F73",
"7. c #0F3D71",
"8. c #547AA4",
"9. c #9CBAD9",
"0. c #B9D3EE",
"a. c #A3C0DE",
"b. c #31629A",
"c. c #659EE0",
"d. c #87BFFE",
"e. c #C3E0FD",
"f. c #4371A4",
"g. c #7496BB",
"h. c #90AFD1",
"i. c #245081",
"j. c #416A96",
"k. c #B0CBE7",
"l. c #CCE4FD",
"m. c #7DB8FD",
"n. c #1E5088",
"o. c #497EBC",
"p. c #C9E3FC",
"q. c #7193B9",
"r. c #C6E0FB",
"s. c #A2CDFE",
"t. c #97C8FE",
"u. c #A7D0FE",
"v. c #BDDCFD",
"w. c #9EC2E8",
"x. c #416996",
"y. c #366AA6",
"z. c #C0DEFC",
"A. c #A2BFDD",
"B. c #326299",
"C. c #649DDF",
"D. c #71ABED",
"E. c #3569A4",
"F. c #0D3C71",
"G. c #6998CD",
"H. c #30639D",
"I. c #A8D3F8",
"J. c #2B5686",
"K. c #3A679B",
"L. c #ADCAEA",
"M. c #85A6C9",
"N. c #33639B",
"O. c #9CCBFD",
"P. c #86C2F7",
"Q. c #0E3C71",
"R. c #1B4C83",
"S. c #5D95D5",
"T. c #557BA5",
"U. c #85C0F6",
"V. c #55A8EF",
"W. c #94B3D3",
"X. c #1C497C",
"Y. c #13437A",
"Z. c #487DBB",
"`. c #7BB7FB",
" + c #76B1F5",
".+ c #4E85C3",
"++ c #ACD3FE",
"@+ c #2F5989",
"#+ c #7597BC",
"$+ c #53A7EF",
"%+ c #C6E1FC",
"&+ c #B6D5F7",
"*+ c #5890D0",
"=+ c #4076B2",
"-+ c #619ADB",
";+ c #7CB7FC",
">+ c #7DB9FE",
",+ c #5087C6",
"'+ c #134479",
")+ c #23548D",
"!+ c #24558D",
"~+ c #8AAACC",
"{+ c #A2C1E1",
"]+ c #86C1F5",
"^+ c #B4D7FE",
"/+ c #6CA5E8",
"(+ c #22548C",
"_+ c #6D94BF",
":+ c #98B6D6",
"<+ c #134174",
"[+ c #84BDF5",
"}+ c #CAE4FC",
"|+ c #CBE3FD",
"1+ c #8FC3FF",
"2+ c #3F72AD",
"3+ c #49719C",
"4+ c #0C3B70",
"5+ c #9CBBDB",
"6+ c #79B7F3",
"7+ c #BFDCFD",
"8+ c #7FBBFF",
"9+ c #7E9FC3",
"0+ c #77B6F3",
"a+ c #A5CEF7",
"b+ c #9FCBFE",
"c+ c #3267A1",
"d+ c #A4CDF7",
"e+ c #B9D9FA",
"f+ c #C7E1FD",
"g+ c #90C3FF",
"h+ c #15457C",
"i+ c #558CCB",
"j+ c #2E5889",
"k+ c #7B9CC1",
"l+ c #C4DDF6",
"m+ c #BBDAFA",
"n+ c #CDE5FD",
"o+ c #B3D6FE",
"p+ c #80BAFF",
"q+ c #4E84C3",
"r+ c #3E73AF",
"s+ c #78B3F7",
"t+ c #5991D1",
"u+ c #477DBA",
"v+ c #4075B2",
"w+ c #5783B6",
"x+ c #BDD6F0",
"y+ c #A1CBF6",
"z+ c #90C4FF",
"A+ c #BCDBFD",
"B+ c #73B0F1",
"C+ c #C5E0FB",
"D+ c #91C5FF",
"E+ c #AED3FE",
"F+ c #C9E2FC",
"G+ c #76B2F2",
"H+ c #8BBFF9",
"I+ c #81BBFE",
"J+ c #9ECBFE",
"K+ c #84B8F3",
"L+ c #79B4F4",
"M+ c #88BEFA",
"N+ c #83BCFE",
"O+ c #A4CFFC",
"P+ c #A6CDF6",
"Q+ c #82B8F2",
"R+ c #529BEC",
" . + @ # $ % & * = ",
" - ; > > , ' ) ! ~ { { { ] ^ ",
" / ; > > > > ; ( _ : < { { { { { [ } ",
" | 1 2 > > > 2 3 4 5 { { { { { 6 { { { 7 ",
" 8 $ < 9 0 a b c d e { { { { f g h { { { { i ",
" j k l m n n n n n n o { { p q r n s { { { { { i ",
" t u v n n n n n n n n o { { w n n n s { { { { { { x ",
" y z A n n n n n n n n n o { { o n n n s { { { { { { B C ",
" D E n n n F G H I n n n o { { o n n n s { { { { { J K % ",
" L M n n n N O { { s n n n o { { o n n P Q { { { { { R > > S ",
" T n n n n H { { { s n n n o { { o U V 6 W X Y Z ` ...> > +. ",
" @.n n n #.{ { { { s n n n o { { $.%.W &.U n n n n n v *.> > =.",
"-.;.n n n >.{ { { { s n n n ,.{ { { '.).n n n n n n n n !.~.> {.",
"].^.n n n q { { { { s n /.(.{ { _.:.n n n n n n n n n n n m <.[.",
"}.|.n n n H { { { { 1.2.3.{ 4.5.6.n n n 7.8.9.0.a.b.n n n n c.d.",
"e.f.n n n g.{ { { { { { { h.i.n n n n j.k.{ { { l.m.n.n n n o.$ ",
"p.q.n n n /.r.s.t.u.v.w.x.n n n n i.h.{ { { { { { u.o.n n n y.$ ",
"z.A.n n n n B.C.D.u E.F.n n n 6.5.4.{ 3.2.1.{ { { { G.n n n H.d.",
"I.p J.n n n n n n n n n n n K.L.{ { (./.n s { { { { M.n n n N.O.",
"P.{ (.Q.n n n n n n n n R.S.> K _ ,.n n n s { { { { 5.n n n T.U.",
"V.{ { W.X.n n n n n Y.Z.`. +.+> ++o n n n s { { { { @+n n n #+$+",
" %+{ { &+*+Z.=+a -+;+>+,+'+)+> > !+n n n s { { { ~+n n n n {+ ",
" ]+{ { ^+> > > > > /+(+n n )+> > )+n n n _+{ { :+<+n n n o [+ ",
" }+{ |+1+> > > > l n n n )+> > )+n n n 2+~+3+E n n n 4+5+ ",
" 6+{ { 7+8+> > > l n n n )+> > )+n n n n n n n n n F 9+0+ ",
" a+{ { b+> > > l n n n c+> > )+n n n n n n n n r O d+ ",
" e+{ f+g+> > l n h+i+<.> > )+n n n n n E j+k+l+m+ ",
" e+{ n+o+p+q+r+s+> > > > t+u+v+w+2.W.x+{ { e+ ",
" y+{ { z+>+> > > > > > > > > A+{ { { { d+ ",
" B+C+) > > > > > > > > D+E+{ { { F+G+ ",
" H+I+> > > > > > J+{ { { C+K+ ",
" L+M+# N+; 8+O+P+Q+R+ "};

33
misc/Makefile Normal file
View File

@@ -0,0 +1,33 @@
PYTHON = python3
PREFIX = /usr/local
DESTDIR =
ICONSIZES = 16 24 32 48 64 128 256 512
SETUPTOOLSOPTIONS =
ifdef DESTDIR
SETUPTOOLSOPTS = --root="$(DESTDIR)"
endif
.PHONY: install
doc/qutebrowser.1.html:
a2x -f manpage doc/qutebrowser.1.asciidoc
install: doc/qutebrowser.1.html
$(PYTHON) setup.py install --prefix="$(PREFIX)" --optimize=1 $(SETUPTOOLSOPTS)
install -Dm644 misc/qutebrowser.appdata.xml \
"$(DESTDIR)$(PREFIX)/share/metainfo/qutebrowser.appdata.xml"
install -Dm644 doc/qutebrowser.1 \
"$(DESTDIR)$(PREFIX)/share/man/man1/qutebrowser.1"
install -Dm644 misc/qutebrowser.desktop \
"$(DESTDIR)$(PREFIX)/share/applications/qutebrowser.desktop"
$(foreach i,$(ICONSIZES),install -Dm644 "icons/qutebrowser-$(i)x$(i).png" \
"$(DESTDIR)$(PREFIX)/share/icons/hicolor/$(i)x$(i)/apps/qutebrowser.png";)
install -Dm644 icons/qutebrowser.svg \
"$(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/qutebrowser.svg"
install -Dm755 -t "$(DESTDIR)$(PREFIX)/share/qutebrowser/userscripts/" \
$(wildcard misc/userscripts/*)
install -Dm755 -t "$(DESTDIR)$(PREFIX)/share/qutebrowser/scripts/" \
$(filter-out scripts/__init__.py scripts/__pycache__ scripts/dev \
scripts/testbrowser scripts/asciidoc2html.py scripts/setupcommon.py \
scripts/link_pyqt.py,$(wildcard scripts/*))

View File

@@ -13,7 +13,7 @@
height="682.66669"
id="svg2"
sodipodi:version="0.32"
inkscape:version="0.92.1 r"
inkscape:version="0.92.2 5c3e80d, 2017-08-06"
version="1.0"
sodipodi:docname="cheatsheet.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
@@ -32,9 +32,9 @@
objecttolerance="10"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.7582312"
inkscape:cx="513.85167"
inkscape:cy="273.37342"
inkscape:zoom="1.7536248"
inkscape:cx="430.72917"
inkscape:cy="268.64059"
inkscape:document-units="px"
inkscape:current-layer="layer1"
width="1024px"
@@ -47,7 +47,9 @@
showguides="true"
inkscape:guide-bbox="true"
inkscape:window-maximized="0"
inkscape:snap-text-baseline="true">
inkscape:snap-text-baseline="true"
inkscape:measure-start="0,0"
inkscape:measure-end="0,0">
<inkscape:grid
id="GridFromPre046Settings"
type="xygrid"
@@ -84,9 +86,9 @@
height="64"
width="74.666664"
id="rect3328"
style="font-size:18px;fill:#babdb6;fill-opacity:1;stroke:none;stroke-width:1.06666672" />
style="font-size:18px;fill:#eeeeec;fill-opacity:1;stroke:none;stroke-width:1.06666672" />
<rect
style="font-size:18px;fill:#babdb6;fill-opacity:1;stroke:none;stroke-width:1.06666672"
style="font-size:18px;fill:#eeeeec;fill-opacity:1;stroke:none;stroke-width:1.06666672"
id="rect3330"
width="64"
height="64"
@@ -715,7 +717,7 @@
height="64"
width="63.461262"
id="rect3720"
style="font-size:18px;fill:#babdb6;fill-opacity:1;stroke:none;stroke-width:1.06666672" />
style="font-size:18px;fill:#eeeeec;fill-opacity:1;stroke:none;stroke-width:1.06666672" />
<path
id="path3724"
d="m 854.35172,271.52738 c 21.26539,0 42.53077,0 63.79615,0"
@@ -985,7 +987,7 @@
<g
id="g7167"
transform="translate(74.666662,16.594076)"
style="fill:#babdb6;fill-opacity:1">
style="fill:#eeeeec;fill-opacity:1">
<rect
ry="4.7797003"
y="296.53333"
@@ -993,9 +995,9 @@
height="64"
width="63.461262"
id="rect7169"
style="font-size:18px;fill:#babdb6;fill-opacity:1;stroke:none;stroke-width:1.06666672" />
style="font-size:18px;fill:#eeeeec;fill-opacity:1;stroke:none;stroke-width:1.06666672" />
<rect
style="font-size:18px;fill:#babdb6;fill-opacity:1;stroke:none;stroke-width:1.06666672"
style="font-size:18px;fill:#eeeeec;fill-opacity:1;stroke:none;stroke-width:1.06666672"
id="rect7171"
width="63.461262"
height="32"
@@ -1005,7 +1007,7 @@
<path
id="path7173"
d="m 640.14582,329.06667 c 21.0911,0 42.18218,0 63.27327,0"
style="font-size:18px;fill:#babdb6;fill-opacity:1;stroke:#000000;stroke-width:1.16182172px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
style="font-size:18px;fill:#eeeeec;fill-opacity:1;stroke:#000000;stroke-width:1.16182172px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
inkscape:connector-curvature="0" />
</g>
<text
@@ -1303,7 +1305,7 @@
height="64"
width="63.461262"
id="rect3980"
style="font-size:18px;fill:#babdb6;fill-opacity:1;stroke:none;stroke-width:1.06666672" />
style="font-size:18px;fill:#eeeeec;fill-opacity:1;stroke:none;stroke-width:1.06666672" />
<path
id="path3982"
d="m 11.247578,121.66071 c 21.091093,0 42.182176,0 63.273269,0"
@@ -2475,21 +2477,21 @@
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672">prev</tspan></text>
<text
id="text9514-60-8"
y="357.28558"
y="355.28558"
x="588.79791"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:12.80000019px;line-height:0%;font-family:TlwgTypewriter;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.06666672"
xml:space="preserve"><tspan
y="357.28558"
y="355.28558"
x="588.79791"
sodipodi:role="line"
id="tspan5524"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672">save</tspan><tspan
y="364.96558"
y="362.96558"
x="588.79791"
sodipodi:role="line"
id="tspan5530"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672">quick-</tspan><tspan
y="372.64557"
y="370.64557"
x="588.79791"
sodipodi:role="line"
id="tspan5532"
@@ -2688,7 +2690,8 @@
id="flowPara5711"> </flowPara></flowRoot> <flowRoot
xml:space="preserve"
id="flowRoot5691-0"
style="font-style:normal;font-weight:normal;font-size:12.80000019px;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.06666672"><flowRegion
style="font-style:normal;font-weight:normal;font-size:12.80000019px;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.06666672"
transform="translate(0,-10)"><flowRegion
id="flowRegion5693-7"
style="font-family:sans-serif;stroke-width:1.06666672"><rect
id="rect5695-0"
@@ -3039,6 +3042,8 @@
style="font-size:10.66666698px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke-width:1.06666672"
id="flowPara3792">;I - hint images in new tab</flowPara><flowPara
style="font-size:10.66666698px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke-width:1.06666672"
id="flowPara6096">;t - hint inputs</flowPara><flowPara
style="font-size:10.66666698px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke-width:1.06666672"
id="flowPara3794">;o - put hinted URL in cmd. line</flowPara><flowPara
style="font-size:10.66666698px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke-width:1.06666672"
id="flowPara3796">;O - like <flowSpan
@@ -3188,7 +3193,9 @@
style="font-size:10.66666698px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke-width:1.06666672"
id="flowPara4148">&lt;Ctrl-P&gt; - prev. history item</flowPara><flowPara
style="font-size:10.66666698px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke-width:1.06666672"
id="flowPara3935-9">&lt;Ctrl-N&gt; - next history item</flowPara></flowRoot> <rect
id="flowPara3935-9">&lt;Ctrl-N&gt; - next history item</flowPara><flowPara
style="font-size:10.66666698px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke-width:1.06666672"
id="flowPara6189">&lt;Ctrl-D&gt; - delete current item</flowPara></flowRoot> <rect
style="font-size:18px;fill:#eeeeec;fill-opacity:1;stroke:none;stroke-width:1.06666672"
id="rect3764-9"
width="64"
@@ -3440,7 +3447,8 @@
<flowRoot
xml:space="preserve"
id="flowRoot5691-4-9-3-6-6"
style="font-style:normal;font-weight:normal;font-size:12.80000019px;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.06666672"><flowRegion
style="font-style:normal;font-weight:normal;font-size:12.80000019px;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.06666672"
transform="translate(0,10)"><flowRegion
id="flowRegion5693-9-1-7-3-8"
style="font-family:sans-serif;stroke-width:1.06666672"><rect
id="rect5695-9-8-7-7-6"
@@ -3498,5 +3506,221 @@
sodipodi:role="line"
id="tspan4112"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672">mode</tspan></text>
</g>
<text
id="text10564-5"
y="274.2934"
x="873.4303"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:12.80000019px;line-height:0%;font-family:TlwgTypewriter;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.06666672"
xml:space="preserve"><tspan
y="274.2934"
x="873.4303"
sodipodi:role="line"
id="tspan10566-6"
style="font-size:9.60000038px;line-height:0.89999998;stroke-width:1.06666672"> </tspan><tspan
id="tspan10570-91"
y="282.1763"
x="873.4303"
sodipodi:role="line"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672">jump to</tspan><tspan
y="289.85632"
x="873.4303"
sodipodi:role="line"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672"
id="tspan6066">scroll</tspan><tspan
y="297.53632"
x="873.4303"
sodipodi:role="line"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672"
id="tspan6068">mark</tspan></text>
<text
id="text10564-2"
y="362.50635"
x="731.82947"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:12.80000019px;line-height:0%;font-family:TlwgTypewriter;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.06666672"
xml:space="preserve"><tspan
id="tspan10568-0"
y="362.50635"
x="731.82947"
sodipodi:role="line"
style="font-size:9.60000038px;line-height:0.89999998;stroke-width:1.06666672">repeat</tspan><tspan
id="tspan10570-93"
y="370.38925"
x="731.82947"
sodipodi:role="line"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672">cmd</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:12.80000019px;line-height:0%;font-family:TlwgTypewriter;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.06666672"
x="183.06667"
y="97.639633"
id="text7245-1-6"><tspan
sodipodi:role="line"
x="183.06667"
y="97.639633"
id="tspan7366-3-0"
style="font-size:9.60000038px;line-height:0.89999998;stroke-width:1.06666672"> </tspan><tspan
sodipodi:role="line"
x="183.06667"
y="105.52255"
id="tspan7249-4-6"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672">run</tspan><tspan
sodipodi:role="line"
x="183.06667"
y="113.20255"
id="tspan5293-2"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672">macro</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:12.80000019px;line-height:0%;font-family:TlwgTypewriter;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.06666672"
x="117.44301"
y="203.05061"
id="text7245-1-61"><tspan
sodipodi:role="line"
x="117.44301"
y="203.05061"
id="tspan7366-3-8"
style="font-size:9.60000038px;line-height:0.89999998;stroke-width:1.06666672"> </tspan><tspan
sodipodi:role="line"
x="117.44301"
y="210.93353"
id="tspan5293-9"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672">record</tspan><tspan
sodipodi:role="line"
x="117.44301"
y="218.61353"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672"
id="tspan6136">macro</tspan></text>
<text
id="text10564-5-2"
y="125.17836"
x="37.344757"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:12.80000019px;line-height:0%;font-family:TlwgTypewriter;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.06666672"
xml:space="preserve"><tspan
y="125.17836"
x="37.344757"
sodipodi:role="line"
id="tspan10566-6-0"
style="font-size:9.60000038px;line-height:0.89999998;stroke-width:1.06666672"> </tspan><tspan
id="tspan10570-91-2"
y="133.06128"
x="37.344757"
sodipodi:role="line"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672">set</tspan><tspan
y="140.74127"
x="37.344757"
sodipodi:role="line"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672"
id="tspan6066-3">scroll</tspan><tspan
y="148.42128"
x="37.344757"
sodipodi:role="line"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672"
id="tspan6068-7">mark</tspan></text>
<text
id="text9514-60-8-5"
y="323.89648"
x="590.26257"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:12.80000019px;line-height:0%;font-family:TlwgTypewriter;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.06666672"
xml:space="preserve"><tspan
y="323.89648"
x="590.26257"
sodipodi:role="line"
id="tspan5524-9"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672">save</tspan><tspan
y="331.57648"
x="590.26257"
sodipodi:role="line"
id="tspan5530-2"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672">book-</tspan><tspan
y="339.25647"
x="590.26257"
sodipodi:role="line"
id="tspan5532-2"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672">mark</tspan></text>
<text
id="text10564-5-2-8"
y="200.40416"
x="21.280243"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:12.80000019px;line-height:0%;font-family:TlwgTypewriter;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.06666672"
xml:space="preserve"><tspan
y="200.40416"
x="21.280243"
sodipodi:role="line"
id="tspan10566-6-0-9"
style="font-size:9.60000038px;line-height:0.89999998;stroke-width:1.06666672"> </tspan><tspan
id="tspan10570-91-2-7"
y="208.28708"
x="21.280243"
sodipodi:role="line"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672">cycle</tspan><tspan
y="215.96707"
x="21.280243"
sodipodi:role="line"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672"
id="tspan6068-7-6">completion</tspan><tspan
y="223.64708"
x="21.280243"
sodipodi:role="line"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672"
id="tspan6220">items</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:12.80000019px;line-height:0%;font-family:TlwgTypewriter;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.06666672"
x="417.29486"
y="205.18887"
id="text7245-1-3"><tspan
sodipodi:role="line"
x="417.29486"
y="205.18887"
id="tspan7366-3-6"
style="font-size:9.60000038px;line-height:0.89999998;stroke-width:1.06666672"> </tspan><tspan
sodipodi:role="line"
x="417.29486"
y="213.07179"
id="tspan5293-53"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672">toggle</tspan><tspan
sodipodi:role="line"
x="417.29486"
y="220.75179"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672;fill:#ff0000"
id="tspan6091">(12)</tspan><tspan
sodipodi:role="line"
x="417.29486"
y="225.70012"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672"
id="tspan6087" /><tspan
sodipodi:role="line"
x="417.29486"
y="225.70012"
style="font-size:8.53333378px;line-height:0.89999998;stroke-width:1.06666672"
id="tspan6089" /></text>
<flowRoot
transform="translate(-1.2953814,90.2721)"
xml:space="preserve"
id="flowRoot5691-0-5"
style="font-style:normal;font-weight:normal;font-size:12.80000019px;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.06666672"><flowRegion
id="flowRegion5693-7-6"
style="font-family:sans-serif;stroke-width:1.06666672"><rect
id="rect5695-0-2"
width="344"
height="173.33333"
x="19.42783"
y="520.07886"
style="font-family:sans-serif;fill:#000000;stroke-width:1.13777781" /></flowRegion><flowPara
style="font-weight:bold;font-size:10.66666698px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'Sans Bold';fill:#000000;stroke-width:1.06666672"
id="flowPara5701-9-2"><flowSpan
style="font-weight:bold;font-family:sans-serif;-inkscape-font-specification:'Sans Bold';fill:#ff0000;stroke-width:1.06666672"
id="flowSpan5705-5-1">(12)</flowSpan> toggling settings:</flowPara><flowPara
style="font-size:10.66666698px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke-width:1.06666672"
id="flowPara6196">tsh - toggle scripts for the current host (temporarily)</flowPara><flowPara
style="font-size:10.66666698px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke-width:1.06666672"
id="flowPara6200">tSh - like <flowSpan
style="font-style:italic"
id="flowSpan6202">tsh</flowSpan>, but permanently</flowPara><flowPara
style="font-size:10.66666698px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke-width:1.06666672"
id="flowPara6206">tsH/tsu - like <flowSpan
style="font-style:italic"
id="flowSpan6210">tsh</flowSpan>, but including subdomains / with exact URL</flowPara><flowPara
style="font-size:10.66666698px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke-width:1.06666672"
id="flowPara6208">tph - toggle plugins</flowPara></flowRoot> </g>
</svg>

Before

Width:  |  Height:  |  Size: 170 KiB

After

Width:  |  Height:  |  Size: 181 KiB

View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2017 suve <veg@svgames.pl> -->
<component type="desktop">
<id>org.qutebrowser.qutebrowser</id>
<metadata_license>CC-BY-SA-3.0</metadata_license>
<project_license>GPL-3.0</project_license>
<name>qutebrowser</name>
<summary>A keyboard-driven web browser</summary>
<description>
<p>
qutebrowser is a keyboard-focused browser with a minimal GUI.
It was inspired by other browsers/addons like dwb and Vimperator/Pentadactyl,
and is based on Python and PyQt5.
</p>
</description>
<categories>
<category>Network</category>
<category>WebBrowser</category>
</categories>
<provides>
<binary>qutebrowser</binary>
</provides>
<launchable type="desktop-id">qutebrowser.desktop</launchable>
<screenshots>
<screenshot type="default">
<image>https://raw.githubusercontent.com/qutebrowser/qutebrowser/master/doc/img/main.png</image>
</screenshot>
<screenshot>
<image>https://raw.githubusercontent.com/qutebrowser/qutebrowser/master/doc/img/downloads.png</image>
</screenshot>
<screenshot>
<image>https://raw.githubusercontent.com/qutebrowser/qutebrowser/master/doc/img/completion.png</image>
</screenshot>
<screenshot>
<image>https://raw.githubusercontent.com/qutebrowser/qutebrowser/master/doc/img/hints.png</image>
</screenshot>
</screenshots>
<url type="homepage">https://www.qutebrowser.org</url>
<url type="faq">https://qutebrowser.org/doc/faq.html</url>
<url type="help">https://qutebrowser.org/doc/help/</url>
<url type="bugtracker">https://github.com/qutebrowser/qutebrowser/issues/</url>
<url type="donation">https://github.com/qutebrowser/qutebrowser#donating</url>
<releases>
<release version="1.3.0" date="2018-05-04"/>
<release version="1.2.1" date="2018-03-14"/>
<release version="1.2.0" date="2018-03-09"/>
</releases>
</component>

View File

@@ -1,11 +1,12 @@
[Desktop Entry]
Name=qutebrowser
GenericName=Web Browser
Comment=A keyboard-driven, vim-like browser based on PyQt5
Icon=qutebrowser
Type=Application
Categories=Network;WebBrowser;
Exec=qutebrowser %u
Terminal=false
StartupNotify=false
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/qute;
Keywords=Browser

View File

@@ -40,6 +40,8 @@ Section "Install"
; Uninstall old versions
ExecWait 'MsiExec.exe /quiet /qn /norestart /X{633F41F9-FE9B-42D1-9CC4-718CBD01EE11}'
ExecWait 'MsiExec.exe /quiet /qn /norestart /X{9331D947-AC86-4542-A755-A833429C6E69}'
RMDir /r "$INSTDIR\*.*"
CreateDirectory "$INSTDIR"
SetOutPath "$INSTDIR"

View File

@@ -15,7 +15,7 @@ def get_data_files():
('../qutebrowser/img', 'img'),
('../qutebrowser/javascript', 'javascript'),
('../qutebrowser/html/doc', 'html/doc'),
('../qutebrowser/git-commit-id', ''),
('../qutebrowser/git-commit-id', '.'),
('../qutebrowser/config/configdata.yml', 'config'),
]
@@ -58,14 +58,15 @@ exe = EXE(pyz,
icon=icon,
debug=False,
strip=False,
upx=True,
console=False )
upx=False,
console=False,
version='misc/file_version_info.txt')
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx=False,
name='qutebrowser')
app = BUNDLE(coll,

View File

@@ -1,5 +1,5 @@
This directory contains various `requirements` files which are used by `tox` to
have reproducable tests with pinned versions.
have reproducible tests with pinned versions.
The files are generated based on unpinned requirements in `*.txt-raw` files.

View File

@@ -1,3 +1,3 @@
# This file is automatically generated by scripts/dev/recompile_requirements.py
check-manifest==0.35
check-manifest==0.37

View File

@@ -1,9 +1,9 @@
# This file is automatically generated by scripts/dev/recompile_requirements.py
certifi==2017.7.27.1
certifi==2018.4.16
chardet==3.0.4
codecov==2.0.9
coverage==4.4.1
idna==2.6
requests==2.18.4
codecov==2.0.15
coverage==4.5.1
idna==2.7
requests==2.19.1
urllib3==1.22

View File

@@ -1,23 +1,27 @@
# This file is automatically generated by scripts/dev/recompile_requirements.py
flake8==2.6.2 # rq.filter: < 3.0.0
attrs==18.1.0
flake8==3.5.0
flake8-bugbear==18.2.0
flake8-builtins==1.4.1 # rq.filter: != 1.4.0
flake8-comprehensions==1.4.1
flake8-copyright==0.2.0
flake8-debugger==1.4.0 # rq.filter: != 2.0.0
flake8-deprecated==1.2.1
flake8-docstrings==1.0.3 # rq.filter: < 1.1.0
flake8-future-import==0.4.3
flake8-debugger==3.1.0
flake8-deprecated==1.3
flake8-docstrings==1.3.0
flake8-future-import==0.4.4
flake8-mock==0.3
flake8-pep3101==1.0 # rq.filter: < 1.1
flake8-polyfill==1.0.1
flake8-putty==0.4.0
flake8-per-file-ignores==0.6
flake8-polyfill==1.0.2
flake8-string-format==0.2.3
flake8-tidy-imports==1.1.0
flake8-tuple==0.2.13
mccabe==0.6.1
packaging==16.8
pep8-naming==0.4.1
pycodestyle==2.3.1
pydocstyle==1.1.1 # rq.filter: < 2.0.0
pyflakes==1.6.0
pyparsing==2.2.0
pathmatch==0.2.1
pep8-naming==0.7.0
pycodestyle==2.3.1 # rq.filter: < 2.4.0
pydocstyle==2.1.1
pyflakes==2.0.0
six==1.11.0
snowballstemmer==1.2.1
typing==3.6.4

View File

@@ -1,29 +1,23 @@
flake8<3.0.0
flake8
flake8-bugbear
flake8-builtins!=1.4.0
flake8-comprehensions
flake8-copyright
flake8-debugger!=2.0.0
flake8-debugger
flake8-deprecated
flake8-docstrings<1.1.0
flake8-docstrings
flake8-future-import
flake8-mock
flake8-pep3101<1.1
flake8-putty
flake8-per-file-ignores
flake8-string-format
flake8-tidy-imports
flake8-tuple
pep8-naming
pydocstyle<2.0.0
pydocstyle
pyflakes
# Pinned to 2.0.0 otherwise
pycodestyle==2.3.1
# Pinned to 0.5.3 otherwise
mccabe==0.6.1
# https://github.com/PyCQA/pycodestyle/issues/741
#@ filter: pycodestyle < 2.4.0
# Waiting until flake8-putty updated
#@ filter: flake8 < 3.0.0
#@ filter: pydocstyle < 2.0.0
#@ filter: flake8-docstrings < 1.1.0
#@ filter: flake8-pep3101 < 1.1
# https://github.com/JBKahn/flake8-debugger/issues/5
#@ filter: flake8-debugger != 2.0.0
# https://github.com/gforcada/flake8-builtins/issues/36
#@ filter: flake8-builtins != 1.4.0

View File

@@ -1,8 +1,8 @@
# This file is automatically generated by scripts/dev/recompile_requirements.py
appdirs==1.4.3
packaging==16.8
packaging==17.1
pyparsing==2.2.0
setuptools==36.5.0
setuptools==39.2.0
six==1.11.0
wheel==0.30.0
wheel==0.31.1

View File

@@ -1,7 +1,7 @@
# This file is automatically generated by scripts/dev/recompile_requirements.py
altgraph==0.14
altgraph==0.15
future==0.16.0
macholib==1.8
pefile==2017.9.3
-e git+https://github.com/pyinstaller/pyinstaller.git@develop#egg=PyInstaller
macholib==1.9
pefile==2017.11.5
PyInstaller==3.3.1

View File

@@ -1,4 +1 @@
-e git+https://github.com/pyinstaller/pyinstaller.git@develop#egg=PyInstaller
# remove @commit-id for scm installs
#@ replace: @.*# @develop#
PyInstaller

View File

@@ -1,18 +1,18 @@
# This file is automatically generated by scripts/dev/recompile_requirements.py
-e git+https://github.com/PyCQA/astroid.git#egg=astroid
certifi==2017.7.27.1
certifi==2018.4.16
chardet==3.0.4
github3.py==0.9.6
idna==2.6
isort==4.2.15
github3.py==1.1.0
idna==2.7
isort==4.3.4
lazy-object-proxy==1.3.1
mccabe==0.6.1
-e git+https://github.com/PyCQA/pylint.git#egg=pylint
python-dateutil==2.7.3
./scripts/dev/pylint_checkers
requests==2.18.4
requests==2.19.1
six==1.11.0
uritemplate==3.0.0
uritemplate.py==3.0.2
urllib3==1.22
wrapt==1.10.11

View File

@@ -1,18 +1,18 @@
# This file is automatically generated by scripts/dev/recompile_requirements.py
astroid==1.5.3
certifi==2017.7.27.1
astroid==1.6.5
certifi==2018.4.16
chardet==3.0.4
github3.py==0.9.6
idna==2.6
isort==4.2.15
github3.py==1.1.0
idna==2.7
isort==4.3.4
lazy-object-proxy==1.3.1
mccabe==0.6.1
pylint==1.7.4
pylint==1.9.2
python-dateutil==2.7.3
./scripts/dev/pylint_checkers
requests==2.18.4
requests==2.19.1
six==1.11.0
uritemplate==3.0.0
uritemplate.py==3.0.2
urllib3==1.22
wrapt==1.10.11

View File

@@ -1,4 +1,4 @@
# This file is automatically generated by scripts/dev/recompile_requirements.py
PyQt5==5.9
sip==4.19.3
PyQt5==5.11.2
PyQt5-sip==4.19.11

View File

@@ -1,4 +1,4 @@
# This file is automatically generated by scripts/dev/recompile_requirements.py
docutils==0.14
pyroma==2.2
pyroma==2.3.1

View File

@@ -1,7 +1,9 @@
Jinja2
Pygments
pyPEG2
PyYAML
PyYAML!=4.1
colorama
cssutils
attrs
#@ filter: PyYAML != 4.1

View File

@@ -12,12 +12,6 @@ git+https://github.com/jenisys/parse_type.git
hg+https://bitbucket.org/pytest-dev/py
git+https://github.com/pytest-dev/pytest.git@features
git+https://github.com/pytest-dev/pytest-bdd.git
# This is broken at the moment because logfail tries to access
# LogCaptureHandler
# git+https://github.com/eisensheng/pytest-catchlog.git
pytest-catchlog==1.2.2
git+https://github.com/pytest-dev/pytest-cov.git
git+https://github.com/pytest-dev/pytest-faulthandler.git
git+https://github.com/pytest-dev/pytest-instafail.git
@@ -41,8 +35,4 @@ git+https://github.com/pallets/markupsafe.git
hg+http://bitbucket.org/birkenfeld/pygments-main
hg+https://bitbucket.org/fdik/pypeg
git+https://github.com/python-attrs/attrs.git
# Fails to build:
# gcc: error: ext/_yaml.c: No such file or directory
# hg+https://bitbucket.org/xi/pyyaml
PyYAML==3.12
git+https://github.com/yaml/pyyaml.git

View File

@@ -1,39 +1,40 @@
# This file is automatically generated by scripts/dev/recompile_requirements.py
attrs==17.2.0
attrs==18.1.0
beautifulsoup4==4.6.0
cheroot==5.8.3
cheroot==6.3.2
click==6.7
# colorama==0.3.9
coverage==4.4.1
coverage==4.5.1
EasyProcess==0.2.3
fields==5.0.0
Flask==0.12.2
Flask==1.0.2
glob2==0.6
hunter==2.0.1
hypothesis==3.32.0
hunter==2.0.2
hypothesis==3.65.0
itsdangerous==0.24
# Jinja2==2.9.6
# Jinja2==2.10
Mako==1.0.7
# MarkupSafe==1.0
parse==1.8.2
more-itertools==4.2.0
parse==1.8.4
parse-type==0.4.2
py==1.4.34
py-cpuinfo==3.3.0
pytest==3.2.3
pytest-bdd==2.18.2
pluggy==0.6.0
py==1.5.4
py-cpuinfo==4.0.0
pytest==3.6.2
pytest-bdd==2.21.0
pytest-benchmark==3.1.1
pytest-catchlog==1.2.2
pytest-cov==2.5.1
pytest-faulthandler==1.3.1
pytest-instafail==0.3.0
pytest-mock==1.6.3
pytest-qt==2.2.1
pytest-faulthandler==1.5.0
pytest-instafail==0.4.0
pytest-mock==1.10.0
pytest-qt==2.4.1
pytest-repeat==0.4.1
pytest-rerunfailures==3.1
pytest-travis-fold==1.2.0
pytest-xvfb==1.0.0
pytest-rerunfailures==4.1
pytest-travis-fold==1.3.0
pytest-xvfb==1.1.0
PyVirtualDisplay==0.2.1
six==1.11.0
vulture==0.26
Werkzeug==0.12.2
vulture==0.27
Werkzeug==0.14.1

View File

@@ -7,7 +7,6 @@ hypothesis
pytest
pytest-bdd
pytest-benchmark
pytest-catchlog
pytest-cov
pytest-faulthandler
pytest-instafail

View File

@@ -1,6 +1,7 @@
# This file is automatically generated by scripts/dev/recompile_requirements.py
pluggy==0.5.2
py==1.4.34
tox==2.9.1
virtualenv==15.1.0
pluggy==0.6.0
py==1.5.4
six==1.11.0
tox==3.0.0
virtualenv==16.0.0

View File

@@ -1,4 +1 @@
tox
# The latest tox release still depends on pluggy < 0.4...
pluggy==0.4.0

View File

@@ -1,3 +1,3 @@
# This file is automatically generated by scripts/dev/recompile_requirements.py
vulture==0.26
vulture==0.27

View File

@@ -133,18 +133,24 @@ echo "jseval -q $(printjs)" >> "$QUTE_FIFO"
tmpdir=$(mktemp -d)
file_to_cast=${tmpdir}/qutecast
program_=$(command -v castnow)
if [[ "${program_}" == "" ]]; then
msg error "castnow can't be found..."
exit 1
fi
# kill any running instance of castnow
pkill -f /usr/bin/castnow
pkill -f "${program_}"
# start youtube download in stream mode (-o -) into temporary file
youtube-dl -qo - "$1" > ${file_to_cast} &
youtube-dl -qo - "$1" > "${file_to_cast}" &
ytdl_pid=$!
msg info "Casting $1" >> "$QUTE_FIFO"
# start castnow in stream mode to cast on ChromeCast
tail -F "${file_to_cast}" | castnow -
tail -F "${file_to_cast}" | ${program_} -
# cleanup remaining background process and file on disk
kill ${ytdl_pid}
rm -rf ${tmpdir}
rm -rf "${tmpdir}"

View File

@@ -41,7 +41,7 @@
[ -z "$QUTE_URL" ] && QUTE_URL='http://google.com'
url=$(echo "$QUTE_URL" | cat - "$QUTE_CONFIG_DIR/quickmarks" "$QUTE_DATA_DIR/history" | dmenu -l 15 -p qutebrowser)
url=$(echo "$url" | sed -E 's/[^ ]+ +//g' | egrep "https?:" || echo "$url")
url=$(echo "$url" | sed -E 's/[^ ]+ +//g' | grep -E "https?:" || echo "$url")
[ -z "${url// }" ] && exit

View File

@@ -1,4 +1,5 @@
#!/bin/sh
set -euo pipefail
#
# Behavior:
# Userscript for qutebrowser which will take the raw JSON text of the current
@@ -19,29 +20,23 @@
#
# Bryan Gilbert, 2017
# do not run pygmentize on files larger than this amount of bytes
MAX_SIZE_PRETTIFY=10485760 # 10 MB
# default style to monokai if none is provided
STYLE=${1:-monokai}
# format json using jq
FORMATTED_JSON="$(cat "$QUTE_TEXT" | jq '.')"
# if jq command failed or formatted json is empty, assume failure and terminate
if [ $? -ne 0 ] || [ -z "$FORMATTED_JSON" ]; then
echo "Invalid json, aborting..."
exit 1
TEMP_FILE="$(mktemp)"
jq . "$QUTE_TEXT" >"$TEMP_FILE"
# try GNU stat first and then OSX stat if the former fails
FILE_SIZE=$(
stat --printf="%s" "$TEMP_FILE" 2>/dev/null ||
stat -f%z "$TEMP_FILE" 2>/dev/null
)
if [ "$FILE_SIZE" -lt "$MAX_SIZE_PRETTIFY" ]; then
pygmentize -l json -f html -O full,style="$STYLE" <"$TEMP_FILE" >"${TEMP_FILE}_"
mv -f "${TEMP_FILE}_" "$TEMP_FILE"
fi
# calculate the filesize of the json document
FILE_SIZE=$(ls -s --block-size=1048576 "$QUTE_TEXT" | cut -d' ' -f1)
# use pygments to pretty-up the json (syntax highlight) if file is less than 10MB
if [ "$FILE_SIZE" -lt "10" ]; then
FORMATTED_JSON="$(echo "$FORMATTED_JSON" | pygmentize -l json -f html -O full,style=$STYLE)"
fi
# create a temp file and write the formatted json to that file
TEMP_FILE="$(mktemp --suffix '.html')"
echo "$FORMATTED_JSON" > $TEMP_FILE
# send the command to qutebrowser to open the new file containing the formatted json
echo "open -t file://$TEMP_FILE" >> "$QUTE_FIFO"

69
misc/userscripts/getbib Executable file
View File

@@ -0,0 +1,69 @@
#!/usr/bin/env python3
"""Qutebrowser userscript scraping the current web page for DOIs and downloading
corresponding bibtex information.
Set the environment variable 'QUTE_BIB_FILEPATH' to indicate the path to
download to. Otherwise, bibtex information is downloaded to '/tmp' and hence
deleted at reboot.
Installation: see qute://help/userscripts.html
Inspired by
https://ocefpaf.github.io/python4oceanographers/blog/2014/05/19/doi2bibtex/
"""
import os
import sys
import shutil
import re
from collections import Counter
from urllib import parse as url_parse
from urllib import request as url_request
FIFO_PATH = os.getenv("QUTE_FIFO")
def message_fifo(message, level="warning"):
"""Send message to qutebrowser FIFO. The level must be one of 'info',
'warning' (default) or 'error'."""
with open(FIFO_PATH, "w") as fifo:
fifo.write("message-{} '{}'".format(level, message))
source = os.getenv("QUTE_TEXT")
with open(source) as f:
text = f.read()
# find DOIs on page using regex
dval = re.compile(r'(10\.(\d)+/([^(\s\>\"\<)])+)')
# https://stackoverflow.com/a/10324802/3865876, too strict
# dval = re.compile(r'\b(10[.][0-9]{4,}(?:[.][0-9]+)*/(?:(?!["&\'<>])\S)+)\b')
dois = dval.findall(text)
dois = Counter(e[0] for e in dois)
try:
doi = dois.most_common(1)[0][0]
except IndexError:
message_fifo("No DOIs found on page")
sys.exit()
message_fifo("Found {} DOIs on page, selecting {}".format(len(dois), doi),
level="info")
# get bibtex data corresponding to DOI
url = "http://dx.doi.org/" + url_parse.quote(doi)
headers = dict(Accept='text/bibliography; style=bibtex')
request = url_request.Request(url, headers=headers)
response = url_request.urlopen(request)
status_code = response.getcode()
if status_code >= 400:
message_fifo("Request returned {}".format(status_code))
sys.exit()
# obtain content and format it
bibtex = response.read().decode("utf-8").strip()
bibtex = bibtex.replace(" ", "\n ", 1).\
replace("}, ", "},\n ").replace("}}", "}\n}")
# append to file
bib_filepath = os.getenv("QUTE_BIB_FILEPATH", "/tmp/qute.bib")
with open(bib_filepath, "a") as f:
f.write(bibtex + "\n\n")

View File

@@ -52,7 +52,7 @@ die() {
if ! [ -d "$DOWNLOAD_DIR" ] ; then
die "Download directory »$DOWNLOAD_DIR« not found!"
fi
if ! which "${ROFI_CMD}" > /dev/null ; then
if ! command -v "${ROFI_CMD}" > /dev/null ; then
die "Rofi command »${ROFI_CMD}« not found in PATH!"
fi
@@ -76,6 +76,7 @@ crop-first-column() {
ls-files() {
# add the slash at the end of the download dir enforces to follow the
# symlink, if the DOWNLOAD_DIR itself is a symlink
# shellcheck disable=SC2010
ls -Q --quoting-style escape -h -o -1 -A -t "${DOWNLOAD_DIR}/" \
| grep '^[-]' \
| cut -d' ' -f3- \
@@ -91,10 +92,10 @@ if [ "${#entries[@]}" -eq 0 ] ; then
die "Download directory »${DOWNLOAD_DIR}« empty"
fi
line=$(printf "%s\n" "${entries[@]}" \
line=$(printf '%s\n' "${entries[@]}" \
| crop-first-column 55 \
| column -s $'\t' -t \
| $ROFI_CMD "${rofi_default_args[@]}" $ROFI_ARGS) || true
| $ROFI_CMD "${rofi_default_args[@]}" "$ROFI_ARGS") || true
if [ -z "$line" ]; then
exit 0
fi

View File

@@ -64,7 +64,7 @@ die() {
javascript_escape() {
# print the first argument in an escaped way, such that it can safely
# be used within javascripts double quotes
sed "s,[\\\'\"],\\\&,g" <<< "$1"
sed "s,[\\\\'\"],\\\\&,g" <<< "$1"
}
# ======================================================= #
@@ -178,7 +178,7 @@ choose_entry_menu() {
if [ "$nr" -eq 1 ] && ! ((menu_if_one_entry)) ; then
file="${files[0]}"
else
file=$( printf "%s\n" "${files[@]}" | "${MENU_COMMAND[@]}" )
file=$( printf '%s\n' "${files[@]}" | "${MENU_COMMAND[@]}" )
fi
}
@@ -220,7 +220,7 @@ user_pattern='^(user|username|login): '
GPG_OPTS=( "--quiet" "--yes" "--compress-algo=none" "--no-encrypt-to" )
GPG="gpg"
export GPG_TTY="${GPG_TTY:-$(tty 2>/dev/null)}"
which gpg2 &>/dev/null && GPG="gpg2"
command -v gpg2 &>/dev/null && GPG="gpg2"
[[ -n $GPG_AGENT_INFO || $GPG == "gpg2" ]] && GPG_OPTS+=( "--batch" "--use-agent" )
pass_backend() {
@@ -236,7 +236,7 @@ pass_backend() {
if ((match_line)) ; then
# add entries with matching URL-tag
while read -r -d "" passfile ; do
if $GPG "${GPG_OPTS}" -d "$passfile" \
if $GPG "${GPG_OPTS[@]}" -d "$passfile" \
| grep --max-count=1 -iE "${match_line_pattern}${url}" > /dev/null
then
passfile="${passfile#$PREFIX}"
@@ -269,7 +269,7 @@ pass_backend() {
break
fi
fi
done < <($GPG "${GPG_OPTS}" -d "$path" )
done < <($GPG "${GPG_OPTS[@]}" -d "$path" )
}
}
# =======================================================
@@ -283,8 +283,8 @@ secret_backend() {
query_entries() {
local domain="$1"
while read -r line ; do
if [[ "$line" =~ "attribute.username = " ]] ; then
files+=("$domain ${line#${BASH_REMATCH[0]}}")
if [[ "$line" == "attribute.username = "* ]] ; then
files+=("$domain ${line:21}")
fi
done < <( secret-tool search --unlock --all domain "$domain" 2>&1 )
}
@@ -303,6 +303,7 @@ pass_backend
QUTE_CONFIG_DIR=${QUTE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/qutebrowser/}
PWFILL_CONFIG=${PWFILL_CONFIG:-${QUTE_CONFIG_DIR}/password_fill_rc}
if [ -f "$PWFILL_CONFIG" ] ; then
# shellcheck source=/dev/null
source "$PWFILL_CONFIG"
fi
init
@@ -311,7 +312,7 @@ simplify_url "$QUTE_URL"
query_entries "${simple_url}"
no_entries_found
# remove duplicates
mapfile -t files < <(printf "%s\n" "${files[@]}" | sort | uniq )
mapfile -t files < <(printf '%s\n' "${files[@]}" | sort | uniq )
choose_entry
if [ -z "$file" ] ; then
# choose_entry didn't want any of these entries

261
misc/userscripts/qute-keepass Executable file
View File

@@ -0,0 +1,261 @@
#!/usr/bin/env python3
# Copyright 2018 Jay Kamat <jaygkamat@gmail.com>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# qutebrowser is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
"""This userscript allows for insertion of usernames and passwords from keepass
databases using pykeepass. Since it is a userscript, it must be run from
qutebrowser.
A sample invocation of this script is:
:spawn --userscript qute-keepass -p ~/KeePassFiles/MainDatabase.kdbx
And a sample binding
:bind --mode=insert <ctrl-i> spawn --userscript qute-keepass -p ~/KeePassFiles/MainDatabase.kdbx
-p or --path is a required argument.
--keyfile-path allows you to specify a keepass keyfile. If you only use a
keyfile, also add --no-password as well. Specifying --no-password without
--keyfile-path will lead to an error.
login information is inserted using :insert-text and :fake-key <Tab>, which
means you must have a cursor in position before initiating this userscript. If
you do not do this, you will get 'element not editable' errors.
If keepass takes a while to open the DB, you might want to consider reducing
the number of transform rounds in your database settings.
Dependencies: pykeepass (in python3), PyQt5. Without pykeepass, you will get an
exit code of 100.
********************!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!******************
WARNING: The login details are viewable as plaintext in qutebrowser's debug log
(qute://log) and could be compromised if you decide to submit a crash report!
********************!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!******************
"""
# pylint: disable=bad-builtin
import argparse
import enum
import functools
import os
import shlex
import subprocess
import sys
from PyQt5.QtCore import QUrl
from PyQt5.QtWidgets import QApplication, QInputDialog, QLineEdit
try:
import pykeepass
except ImportError as e:
print("pykeepass not found: {}".format(str(e)), file=sys.stderr)
# Since this is a common error, try to print it to the FIFO if we can.
if 'QUTE_FIFO' in os.environ:
with open(os.environ['QUTE_FIFO'], 'w') as fifo:
fifo.write('message-error "pykeepass failed to be imported."\n')
fifo.flush()
sys.exit(100)
argument_parser = argparse.ArgumentParser(
description="Fill passwords using keepass.",
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog=__doc__)
argument_parser.add_argument('url', nargs='?', default=os.getenv('QUTE_URL'))
argument_parser.add_argument('--path', '-p', required=True,
help='Path to the keepass db.')
argument_parser.add_argument('--keyfile-path', '-k', default=None,
help='Path to a keepass keyfile')
argument_parser.add_argument(
'--no-password', action='store_true',
help='Supply if no password is required to unlock this database. '
'Only allowed with --keyfile-path')
argument_parser.add_argument(
'--dmenu-invocation', '-d', default='dmenu',
help='Invocation used to execute a dmenu-provider')
argument_parser.add_argument(
'--dmenu-format', '-f', default='{title}: {username}',
help='Format string for keys to display in dmenu.'
' Must generate a unique string.')
argument_parser.add_argument(
'--no-insert-mode', '-n', dest='insert_mode', action='store_false',
help="Don't automatically enter insert mode")
argument_parser.add_argument(
'--io-encoding', '-i', default='UTF-8',
help='Encoding used to communicate with subprocesses')
group = argument_parser.add_mutually_exclusive_group()
group.add_argument('--username-fill-only', '-e',
action='store_true', help='Only insert username')
group.add_argument('--password-fill-only', '-w',
action='store_true', help='Only insert password')
CMD_DELAY = 50
class ExitCodes(enum.IntEnum):
"""Stores various exit codes groups to use."""
SUCCESS = 0
FAILURE = 1
# 1 is automatically used if Python throws an exception
NO_CANDIDATES = 2
USER_QUIT = 3
DB_OPEN_FAIL = 4
INTERNAL_ERROR = 10
def qute_command(command):
with open(os.environ['QUTE_FIFO'], 'w') as fifo:
fifo.write(command + '\n')
fifo.flush()
def stderr(to_print):
"""Extra functionality to echo out errors to qb ui."""
print(to_print, file=sys.stderr)
qute_command('message-error "{}"'.format(to_print))
def dmenu(items, invocation, encoding):
"""Runs dmenu with given arguments."""
command = shlex.split(invocation)
process = subprocess.run(command, input='\n'.join(items).encode(encoding),
stdout=subprocess.PIPE)
return process.stdout.decode(encoding).strip()
def get_password():
"""Get a keepass db password from user."""
_app = QApplication(sys.argv)
text, ok = QInputDialog.getText(
None, "KeePass DB Password",
"Please enter your KeePass Master Password",
QLineEdit.Password)
if not ok:
stderr('Password Prompt Rejected.')
sys.exit(ExitCodes.USER_QUIT)
return text
def find_candidates(args, host):
"""Finds candidates that match host"""
file_path = os.path.expanduser(args.path)
# TODO find a way to keep the db open, so we don't open (and query
# password) it every time
pw = None
if not args.no_password:
pw = get_password()
kf = args.keyfile_path
if kf:
kf = os.path.expanduser(kf)
try:
kp = pykeepass.PyKeePass(file_path, password=pw, keyfile=kf)
except Exception as e:
stderr("There was an error opening the DB: {}".format(str(e)))
return kp.find_entries(url="{}{}{}".format(".*", host, ".*"), regex=True)
def candidate_to_str(args, candidate):
"""Turns candidate into a human readable string for dmenu"""
return args.dmenu_format.format(title=candidate.title,
url=candidate.url,
username=candidate.username,
path=candidate.path,
uuid=candidate.uuid)
def candidate_to_secret(candidate):
"""Turns candidate into a generic (user, password) tuple"""
return (candidate.username, candidate.password)
def run(args):
"""Runs qute-keepass"""
if not args.url:
argument_parser.print_help()
return ExitCodes.FAILURE
url_host = QUrl(args.url).host()
if not url_host:
stderr('{} was not parsed as a valid URL!'.format(args.url))
return ExitCodes.INTERNAL_ERROR
# Find candidates matching the host of the given URL
candidates = find_candidates(args, url_host)
if not candidates:
stderr('No candidates for URL {!r} found!'.format(args.url))
return ExitCodes.NO_CANDIDATES
# Create a map so we can get turn the resulting string from dmenu back into
# a candidate
candidates_strs = list(map(functools.partial(candidate_to_str, args),
candidates))
candidates_map = dict(zip(candidates_strs, candidates))
if len(candidates) == 1:
selection = candidates.pop()
else:
selection = dmenu(candidates_strs,
args.dmenu_invocation,
args.io_encoding)
if selection not in candidates_map:
stderr("'{}' was not a valid entry!").format(selection)
return ExitCodes.USER_QUIT
selection = candidates_map[selection]
username, password = candidate_to_secret(selection)
insert_mode = ';; enter-mode insert' if args.insert_mode else ''
if args.username_fill_only:
qute_command('insert-text {}{}'.format(username, insert_mode))
elif args.password_fill_only:
qute_command('insert-text {}{}'.format(password, insert_mode))
else:
# Enter username and password using insert-key and fake-key <Tab>
# (which supports more passwords than fake-key only), then switch back
# into insert-mode, so the form can be directly submitted by hitting
# enter afterwards. It dosen't matter when we go into insert mode, but
# the other commands need to be be executed sequentially, so we add
# delays with later.
qute_command('insert-text {} ;;'
'later {} fake-key <Tab> ;;'
'later {} insert-text {}{}'
.format(username, CMD_DELAY,
CMD_DELAY * 2, password, insert_mode))
return ExitCodes.SUCCESS
if __name__ == '__main__':
arguments = argument_parser.parse_args()
sys.exit(run(arguments))

172
misc/userscripts/qute-lastpass Executable file
View File

@@ -0,0 +1,172 @@
#!/usr/bin/env python3
# Copyright 2017 Chris Braun (cryzed) <cryzed@googlemail.com>
# Adapted for LastPass by Wayne Cheng (welps) <waynethecheng@gmail.com>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published bjy
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# qutebrowser is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
"""
Insert login information using lastpass CLI and a dmenu-compatible application (e.g. dmenu, rofi -dmenu, ...).
A short demonstration can be seen here: https://i.imgur.com/zA61NrF.gifv.
"""
USAGE = """The domain of the site has to be in the name of the LastPass entry, for example: "github.com/cryzed" or
"websites/github.com". The login information is inserted by emulating key events using qutebrowser's fake-key command in this manner:
[USERNAME]<Tab>[PASSWORD], which is compatible with almost all login forms.
You must log into LastPass CLI using `lpass login <email>` prior to use of this script. The LastPass CLI agent only holds your master password for an hour by default. If you wish to change this, please see `man lpass`.
To use in qutebrowser, run: `spawn --userscript qute-lastpass`
"""
EPILOG = """Dependencies: tldextract (Python 3 module), LastPass CLI (1.3 or newer)
WARNING: The login details are viewable as plaintext in qutebrowser's debug log (qute://log) and might be shared if
you decide to submit a crash report!"""
import argparse
import enum
import fnmatch
import functools
import os
import re
import shlex
import subprocess
import sys
import json
import tldextract
argument_parser = argparse.ArgumentParser(
description=__doc__, usage=USAGE, epilog=EPILOG)
argument_parser.add_argument('url', nargs='?', default=os.getenv('QUTE_URL'))
argument_parser.add_argument('--dmenu-invocation', '-d', default='rofi -dmenu',
help='Invocation used to execute a dmenu-provider')
argument_parser.add_argument('--no-insert-mode', '-n', dest='insert_mode', action='store_false',
help="Don't automatically enter insert mode")
argument_parser.add_argument('--io-encoding', '-i', default='UTF-8',
help='Encoding used to communicate with subprocesses')
argument_parser.add_argument('--merge-candidates', '-m', action='store_true',
help='Merge pass candidates for fully-qualified and registered domain name')
group = argument_parser.add_mutually_exclusive_group()
group.add_argument('--username-only', '-e',
action='store_true', help='Only insert username')
group.add_argument('--password-only', '-w',
action='store_true', help='Only insert password')
stderr = functools.partial(print, file=sys.stderr)
class ExitCodes(enum.IntEnum):
SUCCESS = 0
FAILURE = 1
# 1 is automatically used if Python throws an exception
NO_PASS_CANDIDATES = 2
COULD_NOT_MATCH_USERNAME = 3
COULD_NOT_MATCH_PASSWORD = 4
def qute_command(command):
with open(os.environ['QUTE_FIFO'], 'w') as fifo:
fifo.write(command + '\n')
fifo.flush()
def pass_(domain, encoding):
args = ['lpass', 'show', '-x', '-j', '-G', '.*{:s}.*'.format(domain)]
process = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
err = process.stderr.decode(encoding).strip()
if err:
msg = "LastPass CLI returned for {:s} - {:s}".format(domain, err)
stderr(msg)
return '[]'
out = process.stdout.decode(encoding).strip()
return out
def dmenu(items, invocation, encoding):
command = shlex.split(invocation)
process = subprocess.run(command, input='\n'.join(
items).encode(encoding), stdout=subprocess.PIPE)
return process.stdout.decode(encoding).strip()
def fake_key_raw(text):
for character in text:
# Escape all characters by default, space requires special handling
sequence = '" "' if character == ' ' else '\{}'.format(character)
qute_command('fake-key {}'.format(sequence))
def main(arguments):
if not arguments.url:
argument_parser.print_help()
return ExitCodes.FAILURE
extract_result = tldextract.extract(arguments.url)
# Try to find candidates using targets in the following order: fully-qualified domain name (includes subdomains),
# the registered domain name and finally: the IPv4 address if that's what
# the URL represents
candidates = []
for target in filter(None, [extract_result.fqdn, extract_result.registered_domain, extract_result.subdomain + extract_result.domain, extract_result.domain, extract_result.ipv4]):
target_candidates = json.loads(pass_(target, arguments.io_encoding))
if not target_candidates:
continue
candidates = candidates + target_candidates
if not arguments.merge_candidates:
break
else:
if not candidates:
stderr('No pass candidates for URL {!r} found!'.format(
arguments.url))
return ExitCodes.NO_PASS_CANDIDATES
if len(candidates) == 1:
selection = candidates.pop()
else:
choices = ["{:s} | {:s} | {:s} | {:s}".format(c["id"], c["name"], c["url"], c["username"]) for c in candidates]
choice = dmenu(choices, arguments.dmenu_invocation, arguments.io_encoding)
choiceId = choice.split("|")[0].strip()
selection = next((c for (i, c) in enumerate(candidates) if c["id"] == choiceId), None)
# Nothing was selected, simply return
if not selection:
return ExitCodes.SUCCESS
username = selection["username"]
password = selection["password"]
if arguments.username_only:
fake_key_raw(username)
elif arguments.password_only:
fake_key_raw(password)
else:
# Enter username and password using fake-key and <Tab> (which seems to work almost universally), then switch
# back into insert-mode, so the form can be directly submitted by
# hitting enter afterwards
fake_key_raw(username)
qute_command('fake-key <Tab>')
fake_key_raw(password)
if arguments.insert_mode:
qute_command('enter-mode insert')
return ExitCodes.SUCCESS
if __name__ == '__main__':
arguments = argument_parser.parse_args()
sys.exit(main(arguments))

187
misc/userscripts/qute-pass Executable file
View File

@@ -0,0 +1,187 @@
#!/usr/bin/env python3
# Copyright 2017 Chris Braun (cryzed) <cryzed@googlemail.com>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# qutebrowser is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
"""
Insert login information using pass and a dmenu-compatible application (e.g. dmenu, rofi -dmenu, ...). A short
demonstration can be seen here: https://i.imgur.com/KN3XuZP.gif.
"""
USAGE = """The domain of the site has to appear as a segment in the pass path, for example: "github.com/cryzed" or
"websites/github.com". How the username and password are determined is freely configurable using the CLI arguments. The
login information is inserted by emulating key events using qutebrowser's fake-key command in this manner:
[USERNAME]<Tab>[PASSWORD], which is compatible with almost all login forms."""
EPILOG = """Dependencies: tldextract (Python 3 module), pass.
For issues and feedback please use: https://github.com/cryzed/qutebrowser-userscripts.
WARNING: The login details are viewable as plaintext in qutebrowser's debug log (qute://log) and might be shared if
you decide to submit a crash report!"""
import argparse
import enum
import fnmatch
import functools
import os
import re
import shlex
import subprocess
import sys
import tldextract
argument_parser = argparse.ArgumentParser(description=__doc__, usage=USAGE, epilog=EPILOG)
argument_parser.add_argument('url', nargs='?', default=os.getenv('QUTE_URL'))
argument_parser.add_argument('--password-store', '-p', default=os.path.expanduser('~/.password-store'),
help='Path to your pass password-store')
argument_parser.add_argument('--username-pattern', '-u', default=r'.*/(.+)',
help='Regular expression that matches the username')
argument_parser.add_argument('--username-target', '-U', choices=['path', 'secret'], default='path',
help='The target for the username regular expression')
argument_parser.add_argument('--password-pattern', '-P', default=r'(.*)',
help='Regular expression that matches the password')
argument_parser.add_argument('--dmenu-invocation', '-d', default='rofi -dmenu',
help='Invocation used to execute a dmenu-provider')
argument_parser.add_argument('--no-insert-mode', '-n', dest='insert_mode', action='store_false',
help="Don't automatically enter insert mode")
argument_parser.add_argument('--io-encoding', '-i', default='UTF-8',
help='Encoding used to communicate with subprocesses')
argument_parser.add_argument('--merge-candidates', '-m', action='store_true',
help='Merge pass candidates for fully-qualified and registered domain name')
group = argument_parser.add_mutually_exclusive_group()
group.add_argument('--username-only', '-e', action='store_true', help='Only insert username')
group.add_argument('--password-only', '-w', action='store_true', help='Only insert password')
stderr = functools.partial(print, file=sys.stderr)
class ExitCodes(enum.IntEnum):
SUCCESS = 0
FAILURE = 1
# 1 is automatically used if Python throws an exception
NO_PASS_CANDIDATES = 2
COULD_NOT_MATCH_USERNAME = 3
COULD_NOT_MATCH_PASSWORD = 4
def qute_command(command):
with open(os.environ['QUTE_FIFO'], 'w') as fifo:
fifo.write(command + '\n')
fifo.flush()
def find_pass_candidates(domain, password_store_path):
candidates = []
for path, directories, file_names in os.walk(password_store_path):
if directories or domain not in path.split(os.path.sep):
continue
# Strip password store path prefix to get the relative pass path
pass_path = path[len(password_store_path) + 1:]
secrets = fnmatch.filter(file_names, '*.gpg')
candidates.extend(os.path.join(pass_path, os.path.splitext(secret)[0]) for secret in secrets)
return candidates
def pass_(path, encoding):
process = subprocess.run(['pass', path], stdout=subprocess.PIPE)
return process.stdout.decode(encoding).strip()
def dmenu(items, invocation, encoding):
command = shlex.split(invocation)
process = subprocess.run(command, input='\n'.join(items).encode(encoding), stdout=subprocess.PIPE)
return process.stdout.decode(encoding).strip()
def fake_key_raw(text):
for character in text:
# Escape all characters by default, space requires special handling
sequence = '" "' if character == ' ' else '\{}'.format(character)
qute_command('fake-key {}'.format(sequence))
def main(arguments):
if not arguments.url:
argument_parser.print_help()
return ExitCodes.FAILURE
extract_result = tldextract.extract(arguments.url)
# Expand potential ~ in paths, since this script won't be called from a shell that does it for us
password_store_path = os.path.expanduser(arguments.password_store)
# Try to find candidates using targets in the following order: fully-qualified domain name (includes subdomains),
# the registered domain name and finally: the IPv4 address if that's what the URL represents
candidates = set()
for target in filter(None, [extract_result.fqdn, extract_result.registered_domain, extract_result.ipv4]):
target_candidates = find_pass_candidates(target, password_store_path)
if not target_candidates:
continue
candidates.update(target_candidates)
if not arguments.merge_candidates:
break
else:
if not candidates:
stderr('No pass candidates for URL {!r} found!'.format(arguments.url))
return ExitCodes.NO_PASS_CANDIDATES
selection = candidates.pop() if len(candidates) == 1 else dmenu(sorted(candidates), arguments.dmenu_invocation,
arguments.io_encoding)
# Nothing was selected, simply return
if not selection:
return ExitCodes.SUCCESS
secret = pass_(selection, arguments.io_encoding)
# Match username
target = selection if arguments.username_target == 'path' else secret
match = re.match(arguments.username_pattern, target)
if not match:
stderr('Failed to match username pattern on {}!'.format(arguments.username_target))
return ExitCodes.COULD_NOT_MATCH_USERNAME
username = match.group(1)
# Match password
match = re.match(arguments.password_pattern, secret)
if not match:
stderr('Failed to match password pattern on secret!')
return ExitCodes.COULD_NOT_MATCH_PASSWORD
password = match.group(1)
if arguments.username_only:
fake_key_raw(username)
elif arguments.password_only:
fake_key_raw(password)
else:
# Enter username and password using fake-key and <Tab> (which seems to work almost universally), then switch
# back into insert-mode, so the form can be directly submitted by hitting enter afterwards
fake_key_raw(username)
qute_command('fake-key <Tab>')
fake_key_raw(password)
if arguments.insert_mode:
qute_command('enter-mode insert')
return ExitCodes.SUCCESS
if __name__ == '__main__':
arguments = argument_parser.parse_args()
sys.exit(main(arguments))

View File

@@ -35,17 +35,12 @@ get_selection() {
# Main
# https://github.com/halfwit/dotfiles/blob/master/.config/dmenu/font
if [[ -s $confdir/dmenu/font ]]; then
read -r font < "$confdir"/dmenu/font
fi
[[ -s $confdir/dmenu/font ]] && read -r font < "$confdir"/dmenu/font
if [[ $font ]]; then
opts+=(-fn "$font")
fi
[[ $font ]] && opts+=(-fn "$font")
if [[ -s $optsfile ]]; then
source "$optsfile"
fi
# shellcheck source=/dev/null
[[ -s $optsfile ]] && source "$optsfile"
url=$(get_selection)
url=${url/*http/http}

View File

@@ -13,7 +13,11 @@
from __future__ import absolute_import
import codecs, os
tmpfile=os.path.expanduser('~/.local/share/qutebrowser/userscripts/readability.html')
tmpfile = os.path.join(
os.environ.get('QUTE_DATA_DIR',
os.path.expanduser('~/.local/share/qutebrowser')),
'userscripts/readability.html')
if not os.path.exists(os.path.dirname(tmpfile)):
os.makedirs(os.path.dirname(tmpfile))

View File

@@ -32,7 +32,7 @@ add_feed () {
if grep -Fq "$1" "feeds"; then
notice "$1 is saved already."
else
printf "%s\n" "$1" >> "feeds"
printf '%s\n' "$1" >> "feeds"
fi
}
@@ -57,7 +57,7 @@ notice () {
# Update a database of a feed and open new URLs
read_items () {
cd read_urls
cd read_urls || return 1
feed_file="$(echo "$1" | tr -d /)"
feed_temp_file="$(mktemp "$feed_file.tmp.XXXXXXXXXX")"
feed_new_items="$(mktemp "$feed_file.new.XXXXXXXXXX")"
@@ -75,7 +75,7 @@ read_items () {
cat "$feed_new_items" >> "$feed_file"
sort -o "$feed_file" "$feed_file"
rm "$feed_temp_file" "$feed_new_items"
fi | while read item; do
fi | while read -r item; do
echo "open -t $item" > "$QUTE_FIFO"
done
}
@@ -85,7 +85,7 @@ if [ ! -d "$config_dir/read_urls" ]; then
mkdir -p "$config_dir/read_urls"
fi
cd "$config_dir"
cd "$config_dir" || exit 1
if [ $# != 0 ]; then
for arg in "$@"; do
@@ -115,7 +115,7 @@ if < /dev/null grep --help 2>&1 | grep -q -- -a; then
text_only="-a"
fi
while read feed_url; do
while read -r feed_url; do
read_items "$feed_url" &
done < "$config_dir/feeds"

View File

@@ -25,12 +25,10 @@
[[ $QUTE_MODE == 'hints' ]] && title=$QUTE_SELECTED_TEXT || title=$QUTE_TITLE
# try to add the task and grab the output
msg="$(task add $title $@ 2>&1)"
if [[ $? == 0 ]]; then
if msg="$(task add "$title" "$*" 2>&1)"; then
# annotate the new task with the url, send the output back to the browser
task +LATEST annotate "$QUTE_URL"
echo "message-info '$msg'" >> $QUTE_FIFO
echo "message-info '$(echo "$msg" | head -n 1)'" >> "$QUTE_FIFO"
else
echo "message-error '$msg'" >> $QUTE_FIFO
echo "message-error '$(echo "$msg" | head -n 1)'" >> "$QUTE_FIFO"
fi

52
misc/userscripts/tor_identity Executable file
View File

@@ -0,0 +1,52 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2018 jnphilipp <mail@jnphilipp.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# qutebrowser is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
# Change your tor identity.
#
# Set a hotkey to launch this script, then:
# :bind ti spawn --userscript tor_identity PASSWORD
#
# Use the hotkey to change your tor identity, press 'ti' to change it.
# https://stem.torproject.org/faq.html#how-do-i-request-a-new-identity-from-tor
#
import os
import sys
try:
from stem import Signal
from stem.control import Controller
except ImportError:
if os.getenv('QUTE_FIFO'):
with open(os.environ['QUTE_FIFO'], 'w') as f:
f.write('message-error "Failed to import stem."')
else:
print('Failed to import stem.')
password = sys.argv[1]
with Controller.from_port(port=9051) as controller:
controller.authenticate(password)
controller.signal(Signal.NEWNYM)
if os.getenv('QUTE_FIFO'):
with open(os.environ['QUTE_FIFO'], 'w') as f:
f.write('message-info "Tor identity changed."')
else:
print('Tor identity changed.')

View File

@@ -49,8 +49,8 @@ msg() {
MPV_COMMAND=${MPV_COMMAND:-mpv}
# Warning: spaces in single flags are not supported
MPV_FLAGS=${MPV_FLAGS:- --force-window --no-terminal --keep-open=yes --ytdl --ytdl-raw-options=yes-playlist=}
video_command=( "$MPV_COMMAND" $MPV_FLAGS )
MPV_FLAGS=${MPV_FLAGS:- --force-window --no-terminal --keep-open=yes --ytdl}
IFS=" " read -r -a video_command <<< "$MPV_COMMAND $MPV_FLAGS"
js() {
cat <<EOF

View File

@@ -1,4 +1,5 @@
[pytest]
log_level = NOTSET
addopts = --strict -rfEw --faulthandler-timeout=90 --instafail --pythonwarnings error --benchmark-columns=Min,Max,Median
testpaths = tests
markers =
@@ -25,7 +26,11 @@ markers =
this: Used to mark tests during development
no_invalid_lines: Don't fail on unparseable lines in end2end tests
issue2478: Tests which are broken on Windows with QtWebEngine, https://github.com/qutebrowser/qutebrowser/issues/2478
issue3572: Tests which are broken with QtWebEngine and Qt 5.10, https://github.com/qutebrowser/qutebrowser/issues/3572
qtbug60673: Tests which are broken if the conversion from orange selection to real selection is flaky
fake_os: Fake utils.is_* to a fake operating system
unicode_locale: Tests which need an unicode locale to work
qtwebkit6021_skip: Tests which would fail on WebKit version 602.1
qt_log_level_fail = WARNING
qt_log_ignore =
^SpellCheck: .*
@@ -50,9 +55,16 @@ qt_log_ignore =
^Error when parsing the netrc file
^Image of format '' blocked because it is not considered safe. If you are sure it is safe to do so, you can white-list the format by setting the environment variable QTWEBKIT_IMAGEFORMAT_WHITELIST=
^QPainter::end: Painter ended with \d+ saved states
^QSslSocket: cannot resolve *
^QSslSocket: cannot resolve .*
^QSslSocket: cannot call unresolved function .*
^Incompatible version of OpenSSL
^QQuickWidget::invalidateRenderControl could not make context current
^libpng warning: iCCP: known incorrect sRGB profile
^inotify_add_watch(".*") failed: "No space left on device"
^inotify_add_watch\(".*"\) failed: "No space left on device"
^QSettings::value: Empty key passed
^Icon theme ".*" not found
^Error receiving trust for a CA certificate
xfail_strict = true
filterwarnings =
# This happens in many qutebrowser dependencies...
ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working:DeprecationWarning

View File

@@ -2,7 +2,7 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
@@ -22,11 +22,11 @@
import os.path
__author__ = "Florian Bruhin"
__copyright__ = "Copyright 2014-2017 Florian Bruhin (The Compiler)"
__copyright__ = "Copyright 2014-2018 Florian Bruhin (The Compiler)"
__license__ = "GPL"
__maintainer__ = __author__
__email__ = "mail@qutebrowser.org"
__version_info__ = (1, 0, 1)
__version_info__ = (1, 4, 0)
__version__ = '.'.join(str(e) for e in __version_info__)
__description__ = "A keyboard-driven, vim-like browser based on PyQt5."

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
@@ -51,7 +51,7 @@ import tokenize
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtGui import QDesktopServices, QPixmap, QIcon, QWindow
from PyQt5.QtCore import (pyqtSlot, qInstallMessageHandler, QTimer, QUrl,
QObject, QEvent, pyqtSignal)
QObject, QEvent, pyqtSignal, Qt)
try:
import hunter
except ImportError:
@@ -64,7 +64,7 @@ from qutebrowser.completion.models import miscmodels
from qutebrowser.commands import cmdutils, runners, cmdexc
from qutebrowser.config import config, websettings, configfiles, configinit
from qutebrowser.browser import (urlmarks, adblock, history, browsertab,
downloads)
qtnetworkdownloads, downloads, greasemonkey)
from qutebrowser.browser.network import proxy
from qutebrowser.browser.webkit import cookies, cache
from qutebrowser.browser.webkit.network import networkmanager
@@ -95,6 +95,7 @@ def run(args):
log.init.debug("Initializing directories...")
standarddir.init(args)
utils.preload_resources()
log.init.debug("Initializing config...")
configinit.early_init(args)
@@ -339,7 +340,7 @@ def _open_startpage(win_id=None):
for cur_win_id in list(window_ids): # Copying as the dict could change
tabbed_browser = objreg.get('tabbed-browser', scope='window',
window=cur_win_id)
if tabbed_browser.count() == 0:
if tabbed_browser.widget.count() == 0:
log.init.debug("Opening start pages")
for url in config.val.url.start_pages:
tabbed_browser.tabopen(url)
@@ -417,7 +418,6 @@ def _init_modules(args, crash_handler):
args: The argparse namespace.
crash_handler: The CrashHandler instance.
"""
# pylint: disable=too-many-statements
log.init.debug("Initializing save manager...")
save_manager = savemanager.SaveManager(qApp)
objreg.register('save-manager', save_manager)
@@ -492,6 +492,13 @@ def _init_modules(args, crash_handler):
diskcache = cache.DiskCache(standarddir.cache(), parent=qApp)
objreg.register('cache', diskcache)
log.init.debug("Initializing downloads...")
download_manager = qtnetworkdownloads.DownloadManager(parent=qApp)
objreg.register('qtnetwork-download-manager', download_manager)
log.init.debug("Initializing Greasemonkey...")
greasemonkey.init()
log.init.debug("Misc initialization...")
macros.init()
# Init backend-specific stuff
@@ -562,8 +569,8 @@ class Quitter:
cwd = os.path.abspath(os.path.dirname(sys.executable))
else:
args = [sys.executable, '-m', 'qutebrowser']
cwd = os.path.join(os.path.abspath(os.path.dirname(
qutebrowser.__file__)), '..')
cwd = os.path.join(
os.path.abspath(os.path.dirname(qutebrowser.__file__)), '..')
if not os.path.isdir(cwd):
# Probably running from a python egg. Let's fallback to
# cwd=None and see if that works out.
@@ -766,6 +773,8 @@ class Quitter:
pre_text="Error while saving {}".format(key))
# Disable storage so removing tempdir will work
websettings.shutdown()
# Disable application proxy factory to fix segfaults with Qt 5.10.1
proxy.shutdown()
# Re-enable faulthandler to stdout, then remove crash log
log.destroy.debug("Deactivating crash log...")
objreg.get('crash-handler').destroy_crashlogfile()
@@ -821,6 +830,7 @@ class Application(QApplication):
self.launch_time = datetime.datetime.now()
self.focusObjectChanged.connect(self.on_focus_object_changed)
self.setAttribute(Qt.AA_UseHighDpiPixmaps, True)
@pyqtSlot(QObject)
def on_focus_object_changed(self, obj):
@@ -833,7 +843,11 @@ class Application(QApplication):
def event(self, e):
"""Handle macOS FileOpen events."""
if e.type() == QEvent.FileOpen:
open_url(e.url(), no_raise=True)
url = e.url()
if url.isValid():
open_url(url, no_raise=True)
else:
message.error("Invalid URL: {}".format(url.errorString()))
else:
return super().event(e)
@@ -869,12 +883,9 @@ class EventFilter(QObject):
super().__init__(parent)
self._activated = True
self._handlers = {
QEvent.MouseButtonDblClick: self._handle_mouse_event,
QEvent.MouseButtonPress: self._handle_mouse_event,
QEvent.MouseButtonRelease: self._handle_mouse_event,
QEvent.MouseMove: self._handle_mouse_event,
QEvent.KeyPress: self._handle_key_event,
QEvent.KeyRelease: self._handle_key_event,
QEvent.ShortcutOverride: self._handle_key_event,
}
def _handle_key_event(self, event):
@@ -892,24 +903,11 @@ class EventFilter(QObject):
return False
try:
man = objreg.get('mode-manager', scope='window', window='current')
return man.eventFilter(event)
return man.handle_event(event)
except objreg.RegistryUnavailableError:
# No window available yet, or not a MainWindow
return False
def _handle_mouse_event(self, _event):
"""Handle a mouse event.
Args:
_event: The QEvent which is about to be delivered.
Return:
True if the event should be filtered, False if it's passed through.
"""
# Mouse cursor shown (overrideCursor None) -> don't filter event
# Mouse cursor hidden (overrideCursor not None) -> filter event
return qApp.overrideCursor() is not None
def eventFilter(self, obj, event):
"""Handle an event.

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
@@ -94,14 +94,8 @@ class HostBlocker:
_done_count: How many files have been read successfully.
_local_hosts_file: The path to the blocked-hosts file.
_config_hosts_file: The path to a blocked-hosts in ~/.config
Class attributes:
WHITELISTED: Hosts which never should be blocked.
"""
WHITELISTED = ('localhost', 'localhost.localdomain', 'broadcasthost',
'local')
def __init__(self):
self._blocked_hosts = set()
self._config_blocked_hosts = set()
@@ -176,8 +170,7 @@ class HostBlocker:
self._config_blocked_hosts)
self._blocked_hosts = set()
self._done_count = 0
download_manager = objreg.get('qtnetwork-download-manager',
scope='window', window='last-focused')
download_manager = objreg.get('qtnetwork-download-manager')
for url in config.val.content.host_blocking.lists:
if url.scheme() == 'file':
filename = url.toLocalFile()
@@ -235,16 +228,14 @@ class HostBlocker:
parts = line.split()
if len(parts) == 1:
# "one host per line" format
host = parts[0]
elif len(parts) == 2:
# /etc/hosts format
host = parts[1]
hosts = [parts[0]]
else:
log.misc.error("Failed to parse: {!r}".format(line))
return False
# /etc/hosts format
hosts = parts[1:]
if host not in self.WHITELISTED:
self._blocked_hosts.add(host)
for host in hosts:
if '.' in host and not host.endswith('.localdomain'):
self._blocked_hosts.add(host)
return True

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
@@ -19,6 +19,7 @@
"""Base class for a wrapper over QWebView/QWebEngineView."""
import enum
import itertools
import attr
@@ -26,11 +27,17 @@ from PyQt5.QtCore import pyqtSignal, pyqtSlot, QUrl, QObject, QSizeF, Qt
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QWidget, QApplication
import pygments
import pygments.lexers
import pygments.formatters
from qutebrowser.keyinput import modeman
from qutebrowser.config import config
from qutebrowser.utils import utils, objreg, usertypes, log, qtutils
from qutebrowser.utils import (utils, objreg, usertypes, log, qtutils,
urlutils, message)
from qutebrowser.misc import miscwidgets, objects
from qutebrowser.browser import mouse, hints
from qutebrowser.qt import sip
tab_id_gen = itertools.count(0)
@@ -74,7 +81,7 @@ class UnsupportedOperationError(WebTabError):
"""Raised when an operation is not supported with the given backend."""
TerminationStatus = usertypes.enum('TerminationStatus', [
TerminationStatus = enum.Enum('TerminationStatus', [
'normal',
'abnormal', # non-zero exit status
'crashed', # e.g. segfault
@@ -93,18 +100,30 @@ class TabData:
load.
inspector: The QWebInspector used for this webview.
viewing_source: Set if we're currently showing a source view.
Only used when sources are shown via pygments.
open_target: Where to open the next link.
Only used for QtWebKit.
override_target: Override for open_target for fake clicks (like hints).
Only used for QtWebKit.
pinned: Flag to pin the tab.
fullscreen: Whether the tab has a video shown fullscreen currently.
netrc_used: Whether netrc authentication was performed.
input_mode: current input mode for the tab.
"""
keep_icon = attr.ib(False)
viewing_source = attr.ib(False)
inspector = attr.ib(None)
open_target = attr.ib(usertypes.ClickTarget.normal)
override_target = attr.ib(None)
pinned = attr.ib(False)
fullscreen = attr.ib(False)
netrc_used = attr.ib(False)
input_mode = attr.ib(usertypes.KeyMode.normal)
def should_show_icon(self):
return (config.val.tabs.favicons.show == 'always' or
config.val.tabs.favicons.show == 'pinned' and self.pinned)
class AbstractAction:
@@ -119,8 +138,9 @@ class AbstractAction:
action_class = None
action_base = None
def __init__(self):
def __init__(self, tab):
self._widget = None
self._tab = tab
def exit_fullscreen(self):
"""Exit the fullscreen mode."""
@@ -137,6 +157,31 @@ class AbstractAction:
raise WebTabError("{} is not a valid web action!".format(name))
self._widget.triggerPageAction(member)
def show_source(self,
pygments=False): # pylint: disable=redefined-outer-name
"""Show the source of the current page in a new tab."""
raise NotImplementedError
def _show_source_pygments(self):
def show_source_cb(source):
"""Show source as soon as it's ready."""
# WORKAROUND for https://github.com/PyCQA/pylint/issues/491
# pylint: disable=no-member
lexer = pygments.lexers.HtmlLexer()
formatter = pygments.formatters.HtmlFormatter(
full=True, linenos='table')
# pylint: enable=no-member
highlighted = pygments.highlight(source, lexer, formatter)
tb = objreg.get('tabbed-browser', scope='window',
window=self._tab.win_id)
new_tab = tb.tabopen(background=False, related=True)
new_tab.set_html(highlighted, self._tab.url())
new_tab.data.viewing_source = True
self._tab.dump_async(show_source_cb)
class AbstractPrinting:
@@ -243,10 +288,10 @@ class AbstractZoom(QObject):
_default_zoom_changed: Whether the zoom was changed from the default.
"""
def __init__(self, win_id, parent=None):
def __init__(self, tab, parent=None):
super().__init__(parent)
self._tab = tab
self._widget = None
self._win_id = win_id
self._default_zoom_changed = False
self._init_neighborlist()
config.instance.changed.connect(self._on_config_changed)
@@ -320,12 +365,18 @@ class AbstractZoom(QObject):
class AbstractCaret(QObject):
"""Attribute of AbstractTab for caret browsing."""
"""Attribute of AbstractTab for caret browsing.
def __init__(self, win_id, tab, mode_manager, parent=None):
Signals:
selection_toggled: Emitted when the selection was toggled.
arg: Whether the selection is now active.
"""
selection_toggled = pyqtSignal(bool)
def __init__(self, tab, mode_manager, parent=None):
super().__init__(parent)
self._tab = tab
self._win_id = win_id
self._widget = None
self.selection_enabled = False
mode_manager.entered.connect(self._on_mode_entered)
@@ -334,7 +385,7 @@ class AbstractCaret(QObject):
def _on_mode_entered(self, mode):
raise NotImplementedError
def _on_mode_left(self):
def _on_mode_left(self, mode):
raise NotImplementedError
def move_to_next_line(self, count=1):
@@ -388,11 +439,15 @@ class AbstractCaret(QObject):
def drop_selection(self):
raise NotImplementedError
def has_selection(self):
def selection(self, callback):
raise NotImplementedError
def selection(self, html=False):
raise NotImplementedError
def _follow_enter(self, tab):
"""Follow a link by faking an enter press."""
if tab:
self._tab.key_press(Qt.Key_Enter, modifier=Qt.ControlModifier)
else:
self._tab.key_press(Qt.Key_Enter)
def follow_selected(self, *, tab=False):
raise NotImplementedError
@@ -430,6 +485,9 @@ class AbstractScroller(QObject):
def to_point(self, point):
raise NotImplementedError
def to_anchor(self, name):
raise NotImplementedError
def delta(self, x=0, y=0):
raise NotImplementedError
@@ -485,6 +543,7 @@ class AbstractHistory:
raise NotImplementedError
def back(self, count=1):
"""Go back in the tab's history."""
idx = self.current_idx() - count
if idx >= 0:
self._go_to_item(self._item_at(idx))
@@ -493,6 +552,7 @@ class AbstractHistory:
raise WebTabError("At beginning of history.")
def forward(self, count=1):
"""Go forward in the tab's history."""
idx = self.current_idx() + count
if idx < len(self):
self._go_to_item(self._item_at(idx))
@@ -574,6 +634,33 @@ class AbstractElements:
raise NotImplementedError
class AbstractAudio(QObject):
"""Handling of audio/muting for this tab."""
muted_changed = pyqtSignal(bool)
recently_audible_changed = pyqtSignal(bool)
def __init__(self, parent=None):
super().__init__(parent)
self._widget = None
def set_muted(self, muted: bool):
"""Set this tab as muted or not."""
raise NotImplementedError
def is_muted(self):
"""Whether this tab is muted."""
raise NotImplementedError
def toggle_muted(self):
self.set_muted(not self.is_muted())
def is_recently_audible(self):
"""Whether this tab has had audio playing recently."""
raise NotImplementedError
class AbstractTab(QWidget):
"""A wrapper over the given widget to hide its API and expose another one.
@@ -605,6 +692,7 @@ class AbstractTab(QWidget):
process terminated.
arg 0: A TerminationStatus member.
arg 1: The exit code.
predicted_navigation: Emitted before we tell Qt to open a URL.
"""
window_close_requested = pyqtSignal()
@@ -622,6 +710,7 @@ class AbstractTab(QWidget):
add_history_item = pyqtSignal(QUrl, QUrl, str) # url, requested url, title
fullscreen_requested = pyqtSignal(bool)
renderer_process_terminated = pyqtSignal(TerminationStatus, int)
predicted_navigation = pyqtSignal(QUrl)
def __init__(self, *, win_id, mode_manager, private, parent=None):
self.private = private
@@ -635,16 +724,6 @@ class AbstractTab(QWidget):
tab_registry[self.tab_id] = self
objreg.register('tab', self, registry=self.registry)
# self.history = AbstractHistory(self)
# self.scroller = AbstractScroller(self, parent=self)
# self.caret = AbstractCaret(win_id=win_id, tab=self,
# mode_manager=mode_manager, parent=self)
# self.zoom = AbstractZoom(win_id=win_id)
# self.search = AbstractSearch(parent=self)
# self.printing = AbstractPrinting()
# self.elements = AbstractElements(self)
# self.action = AbstractAction()
self.data = TabData()
self._layout = miscwidgets.WrapperLayout(self)
self._widget = None
@@ -662,6 +741,8 @@ class AbstractTab(QWidget):
objreg.register('hintmanager', hintmanager, scope='tab',
window=self.win_id, tab=self.tab_id)
self.predicted_navigation.connect(self._on_predicted_navigation)
def _set_widget(self, widget):
# pylint: disable=protected-access
self._widget = widget
@@ -674,6 +755,8 @@ class AbstractTab(QWidget):
self.printing._widget = widget
self.action._widget = widget
self.elements._widget = widget
self.audio._widget = widget
self.settings._settings = widget.settings()
self._install_event_filter()
self.zoom.set_default()
@@ -702,12 +785,26 @@ class AbstractTab(QWidget):
# This only gives us some mild protection against re-using events, but
# it's certainly better than a segfault.
if getattr(evt, 'posted', False):
raise AssertionError("Can't re-use an event which was already "
"posted!")
raise utils.Unreachable("Can't re-use an event which was already "
"posted!")
recipient = self.event_target()
if recipient is None:
# https://github.com/qutebrowser/qutebrowser/issues/3888
log.webview.warning("Unable to find event target!")
return
evt.posted = True
QApplication.postEvent(recipient, evt)
@pyqtSlot(QUrl)
def _on_predicted_navigation(self, url):
"""Adjust the title if we are going to visit an URL soon."""
qtutils.ensure_valid(url)
url_string = url.toDisplayString()
log.webview.debug("Predicted navigation: {}".format(url_string))
self.title_changed.emit(url_string)
@pyqtSlot(QUrl)
def _on_url_changed(self, url):
"""Update title when URL has changed and no title is available."""
@@ -723,6 +820,23 @@ class AbstractTab(QWidget):
self._set_load_status(usertypes.LoadStatus.loading)
self.load_started.emit()
@pyqtSlot(usertypes.NavigationRequest)
def _on_navigation_request(self, navigation):
"""Handle common acceptNavigationRequest code."""
url = utils.elide(navigation.url.toDisplayString(), 100)
log.webview.debug("navigation request: url {}, type {}, is_main_frame "
"{}".format(url,
navigation.navigation_type,
navigation.is_main_frame))
if (navigation.navigation_type == navigation.Type.link_clicked and
not navigation.url.isValid()):
msg = urlutils.get_errstring(navigation.url,
"Invalid link clicked")
message.error(msg)
self.data.open_target = usertypes.ClickTarget.normal
navigation.accepted = False
def handle_auto_insert_mode(self, ok):
"""Handle `input.insert_mode.auto_load` after loading finished."""
if not config.val.input.insert_mode.auto_load or not ok:
@@ -745,6 +859,10 @@ class AbstractTab(QWidget):
@pyqtSlot(bool)
def _on_load_finished(self, ok):
if sip.isdeleted(self._widget):
# https://github.com/qutebrowser/qutebrowser/issues/3498
return
sess_manager = objreg.get('session-manager')
sess_manager.save_autosave()
@@ -757,7 +875,9 @@ class AbstractTab(QWidget):
self._set_load_status(usertypes.LoadStatus.warn)
else:
self._set_load_status(usertypes.LoadStatus.error)
self.load_finished.emit(ok)
if not self.title():
self.title_changed.emit(self.url().toDisplayString())
@@ -773,10 +893,6 @@ class AbstractTab(QWidget):
self._progress = perc
self.load_progress.emit(perc)
@pyqtSlot()
def _on_ssl_errors(self):
self._has_ssl_errors = True
def url(self, requested=False):
raise NotImplementedError
@@ -786,11 +902,12 @@ class AbstractTab(QWidget):
def load_status(self):
return self._load_status
def _openurl_prepare(self, url):
def _openurl_prepare(self, url, *, predict=True):
qtutils.ensure_valid(url)
self.title_changed.emit(url.toDisplayString())
if predict:
self.predicted_navigation.emit(url)
def openurl(self, url):
def openurl(self, url, *, predict=True):
raise NotImplementedError
def reload(self, *, force=False):
@@ -807,7 +924,7 @@ class AbstractTab(QWidget):
raise NotImplementedError
def dump_async(self, callback, *, plain=False):
"""Dump the current page to a file ascync.
"""Dump the current page's html asynchronously.
The given callback will be called with the result when dumping is
complete.
@@ -863,3 +980,6 @@ class AbstractTab(QWidget):
except (AttributeError, RuntimeError) as exc:
url = '<{}>'.format(exc.__class__.__name__)
return utils.get_repr(self, tab_id=self.tab_id, url=url)
def is_deleted(self):
return sip.isdeleted(self._widget)

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
@@ -27,19 +27,19 @@ import collections
import functools
import pathlib
import tempfile
import enum
import sip
from PyQt5.QtCore import (pyqtSlot, pyqtSignal, Qt, QObject, QModelIndex,
QTimer, QAbstractListModel)
QTimer, QAbstractListModel, QUrl)
from qutebrowser.commands import cmdexc, cmdutils
from qutebrowser.config import config
from qutebrowser.utils import (usertypes, standarddir, utils, message, log,
qtutils)
from qutebrowser.qt import sip
ModelRole = usertypes.enum('ModelRole', ['item'], start=Qt.UserRole,
is_int=True)
ModelRole = enum.IntEnum('ModelRole', ['item'], start=Qt.UserRole)
# Remember the last used directory
@@ -103,6 +103,8 @@ def immediate_download_path(prompt_download_directory=None):
if not prompt_download_directory:
return download_dir()
return None
def _path_suggestion(filename):
"""Get the suggested file path.
@@ -137,7 +139,8 @@ def create_full_filename(basename, filename):
encoding = sys.getfilesystemencoding()
filename = utils.force_encoding(filename, encoding)
basename = utils.force_encoding(basename, encoding)
if os.path.isabs(filename) and os.path.isdir(filename):
if os.path.isabs(filename) and (os.path.isdir(filename) or
filename.endswith(os.sep)):
# We got an absolute directory from the user, so we save it under
# the default filename in that directory.
return os.path.join(filename, basename)
@@ -163,6 +166,7 @@ def get_filename_question(*, suggested_filename, url, parent=None):
q.title = "Save file to:"
q.text = "Please enter a location for <b>{}</b>".format(
html.escape(url.toDisplayString()))
q.url = url.toString(QUrl.RemovePassword | QUrl.FullyEncoded)
q.mode = usertypes.PromptMode.download
q.completed.connect(q.deleteLater)
q.default = _path_suggestion(suggested_filename)
@@ -179,7 +183,7 @@ def transform_path(path):
path = utils.expand_windows_drive(path)
# Drive dependent working directories are not supported, e.g.
# E:filename is invalid
if re.match(r'[A-Z]:[^\\]', path, re.IGNORECASE):
if re.search(r'^[A-Z]:[^\\]', path, re.IGNORECASE):
return None
# Paths like COM1, ...
# See https://github.com/qutebrowser/qutebrowser/issues/82
@@ -234,11 +238,14 @@ class FileDownloadTarget(_DownloadTarget):
Attributes:
filename: Filename where the download should be saved.
force_overwrite: Whether to overwrite the target without
prompting the user.
"""
def __init__(self, filename):
def __init__(self, filename, force_overwrite=False):
# pylint: disable=super-init-not-called
self.filename = filename
self.force_overwrite = force_overwrite
def suggested_filename(self):
return os.path.basename(self.filename)
@@ -604,6 +611,11 @@ class AbstractDownloadItem(QObject):
"""Ask a confirmation question for the download."""
raise NotImplementedError
def _ask_create_parent_question(self, title, msg,
force_overwrite, remember_directory):
"""Ask a confirmation question for the parent directory."""
raise NotImplementedError
def _set_fileobj(self, fileobj, *, autoclose=True):
"""Set a file object to save the download to.
@@ -630,7 +642,6 @@ class AbstractDownloadItem(QObject):
remember_directory: If True, remember the directory for future
downloads.
"""
global last_used_directory
filename = os.path.expanduser(filename)
self._ensure_can_set_filename(filename)
@@ -657,11 +668,41 @@ class AbstractDownloadItem(QObject):
self._filename = create_full_filename(self.basename,
os.path.expanduser('~'))
dirname = os.path.dirname(self._filename)
if not os.path.exists(dirname):
txt = ("<b>{}</b> does not exist. Create it?".
format(html.escape(
os.path.join(dirname, ""))))
self._ask_create_parent_question("Create directory?", txt,
force_overwrite,
remember_directory)
else:
self._after_create_parent_question(force_overwrite,
remember_directory)
def _after_create_parent_question(self,
force_overwrite, remember_directory):
"""After asking about parent directory.
Args:
force_overwrite: Force overwriting existing files.
remember_directory: If True, remember the directory for future
downloads.
"""
global last_used_directory
try:
os.makedirs(os.path.dirname(self._filename))
except FileExistsError:
pass
except OSError as e:
self._die(e.strerror)
self.basename = os.path.basename(self._filename)
if remember_directory:
last_used_directory = os.path.dirname(self._filename)
log.downloads.debug("Setting filename to {}".format(filename))
log.downloads.debug("Setting filename to {}".format(self._filename))
if force_overwrite:
self._after_set_filename()
elif os.path.isfile(self._filename):
@@ -700,7 +741,8 @@ class AbstractDownloadItem(QObject):
if isinstance(target, FileObjDownloadTarget):
self._set_fileobj(target.fileobj, autoclose=False)
elif isinstance(target, FileDownloadTarget):
self._set_filename(target.filename)
self._set_filename(
target.filename, force_overwrite=target.force_overwrite)
elif isinstance(target, OpenFileDownloadTarget):
try:
fobj = temp_download_manager.get_tmpfile(self.basename)
@@ -955,7 +997,7 @@ class DownloadModel(QAbstractListModel):
if not count:
count = len(self)
raise cmdexc.CommandError("Download {} is already done!"
.format(count))
.format(count))
download.cancel()
@cmdutils.register(instance='download-model', scope='window')

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
@@ -21,13 +21,13 @@
import functools
import sip
from PyQt5.QtCore import pyqtSlot, QSize, Qt, QTimer
from PyQt5.QtWidgets import QListView, QSizePolicy, QMenu, QStyleFactory
from qutebrowser.browser import downloads
from qutebrowser.config import config
from qutebrowser.utils import qtutils, utils, objreg
from qutebrowser.qt import sip
def update_geometry(obj):

View File

@@ -0,0 +1,382 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2017-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# qutebrowser is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
"""Load, parse and make available Greasemonkey scripts."""
import re
import os
import json
import fnmatch
import functools
import glob
import textwrap
import attr
from PyQt5.QtCore import pyqtSignal, QObject, QUrl
from qutebrowser.utils import (log, standarddir, jinja, objreg, utils,
javascript, urlmatch, version, usertypes)
from qutebrowser.commands import cmdutils
from qutebrowser.browser import downloads
from qutebrowser.misc import objects
def _scripts_dir():
"""Get the directory of the scripts."""
return os.path.join(standarddir.data(), 'greasemonkey')
class GreasemonkeyScript:
"""Container class for userscripts, parses metadata blocks."""
def __init__(self, properties, code):
self._code = code
self.includes = []
self.matches = []
self.excludes = []
self.requires = []
self.description = None
self.name = None
self.namespace = None
self.run_at = None
self.script_meta = None
self.runs_on_sub_frames = True
self.jsworld = "main"
for name, value in properties:
if name == 'name':
self.name = value
elif name == 'namespace':
self.namespace = value
elif name == 'description':
self.description = value
elif name == 'include':
self.includes.append(value)
elif name == 'match':
self.matches.append(value)
elif name in ['exclude', 'exclude_match']:
self.excludes.append(value)
elif name == 'run-at':
self.run_at = value
elif name == 'noframes':
self.runs_on_sub_frames = False
elif name == 'require':
self.requires.append(value)
elif name == 'qute-js-world':
self.jsworld = value
HEADER_REGEX = r'// ==UserScript==|\n+// ==/UserScript==\n'
PROPS_REGEX = r'// @(?P<prop>[^\s]+)\s*(?P<val>.*)'
@classmethod
def parse(cls, source):
"""GreasemonkeyScript factory.
Takes a userscript source and returns a GreasemonkeyScript.
Parses the Greasemonkey metadata block, if present, to fill out
attributes.
"""
matches = re.split(cls.HEADER_REGEX, source, maxsplit=2)
try:
_head, props, _code = matches
except ValueError:
props = ""
script = cls(re.findall(cls.PROPS_REGEX, props), source)
script.script_meta = props
if not script.includes and not script.matches:
script.includes = ['*']
return script
def code(self):
"""Return the processed JavaScript code of this script.
Adorns the source code with GM_* methods for Greasemonkey
compatibility and wraps it in an IIFE to hide it within a
lexical scope. Note that this means line numbers in your
browser's debugger/inspector will not match up to the line
numbers in the source script directly.
"""
# Don't use Proxy on this webkit version, the support isn't there.
use_proxy = not (
objects.backend == usertypes.Backend.QtWebKit and
version.qWebKitVersion() == '602.1')
template = jinja.js_environment.get_template('greasemonkey_wrapper.js')
return template.render(
scriptName=javascript.string_escape(
"/".join([self.namespace or '', self.name])),
scriptInfo=self._meta_json(),
scriptMeta=javascript.string_escape(self.script_meta),
scriptSource=self._code,
use_proxy=use_proxy)
def _meta_json(self):
return json.dumps({
'name': self.name,
'description': self.description,
'matches': self.matches,
'includes': self.includes,
'excludes': self.excludes,
'run-at': self.run_at,
})
def add_required_script(self, source):
"""Add the source of a required script to this script."""
# The additional source is indented in case it also contains a
# metadata block. Because we pass everything at once to
# QWebEngineScript and that would parse the first metadata block
# found as the valid one.
self._code = "\n".join([textwrap.indent(source, " "), self._code])
@attr.s
class MatchingScripts(object):
"""All userscripts registered to run on a particular url."""
url = attr.ib()
start = attr.ib(default=attr.Factory(list))
end = attr.ib(default=attr.Factory(list))
idle = attr.ib(default=attr.Factory(list))
class GreasemonkeyMatcher:
"""Check whether scripts should be loaded for a given URL."""
# https://wiki.greasespot.net/Include_and_exclude_rules#Greaseable_schemes
# Limit the schemes scripts can run on due to unreasonable levels of
# exploitability
GREASEABLE_SCHEMES = ['http', 'https', 'ftp', 'file']
def __init__(self, url):
self._url = url
self._url_string = url.toString(QUrl.FullyEncoded)
self.is_greaseable = url.scheme() in self.GREASEABLE_SCHEMES
def _match_pattern(self, pattern):
# For include and exclude rules if they start and end with '/' they
# should be treated as a (ecma syntax) regular expression.
if pattern.startswith('/') and pattern.endswith('/'):
matches = re.search(pattern[1:-1], self._url_string, flags=re.I)
return matches is not None
# Otherwise they are glob expressions.
return fnmatch.fnmatch(self._url_string, pattern)
def matches(self, script):
"""Check whether the URL matches filtering rules of the script."""
assert self.is_greaseable
matching_includes = any(self._match_pattern(pat)
for pat in script.includes)
matching_match = any(urlmatch.UrlPattern(pat).matches(self._url)
for pat in script.matches)
matching_excludes = any(self._match_pattern(pat)
for pat in script.excludes)
return (matching_includes or matching_match) and not matching_excludes
class GreasemonkeyManager(QObject):
"""Manager of userscripts and a Greasemonkey compatible environment.
Signals:
scripts_reloaded: Emitted when scripts are reloaded from disk.
Any cached or already-injected scripts should be
considered obsolete.
"""
scripts_reloaded = pyqtSignal()
def __init__(self, parent=None):
super().__init__(parent)
self._run_start = []
self._run_end = []
self._run_idle = []
self._in_progress_dls = []
self.load_scripts()
@cmdutils.register(name='greasemonkey-reload',
instance='greasemonkey')
def load_scripts(self, force=False):
"""Re-read Greasemonkey scripts from disk.
The scripts are read from a 'greasemonkey' subdirectory in
qutebrowser's data directory (see `:version`).
Args:
force: For any scripts that have required dependencies,
re-download them.
"""
self._run_start = []
self._run_end = []
self._run_idle = []
scripts_dir = os.path.abspath(_scripts_dir())
log.greasemonkey.debug("Reading scripts from: {}".format(scripts_dir))
for script_filename in glob.glob(os.path.join(scripts_dir, '*.js')):
if not os.path.isfile(script_filename):
continue
script_path = os.path.join(scripts_dir, script_filename)
with open(script_path, encoding='utf-8') as script_file:
script = GreasemonkeyScript.parse(script_file.read())
if not script.name:
script.name = script_filename
self.add_script(script, force)
self.scripts_reloaded.emit()
def add_script(self, script, force=False):
"""Add a GreasemonkeyScript to this manager.
Args:
force: Fetch and overwrite any dependancies which are
already locally cached.
"""
if script.requires:
log.greasemonkey.debug(
"Deferring script until requirements are "
"fulfilled: {}".format(script.name))
self._get_required_scripts(script, force)
else:
self._add_script(script)
def _add_script(self, script):
if script.run_at == 'document-start':
self._run_start.append(script)
elif script.run_at == 'document-end':
self._run_end.append(script)
elif script.run_at == 'document-idle':
self._run_idle.append(script)
else:
if script.run_at:
log.greasemonkey.warning("Script {} has invalid run-at "
"defined, defaulting to "
"document-end"
.format(script.name))
# Default as per
# https://wiki.greasespot.net/Metadata_Block#.40run-at
self._run_end.append(script)
log.greasemonkey.debug("Loaded script: {}".format(script.name))
def _required_url_to_file_path(self, url):
requires_dir = os.path.join(_scripts_dir(), 'requires')
if not os.path.exists(requires_dir):
os.mkdir(requires_dir)
return os.path.join(requires_dir, utils.sanitize_filename(url))
def _on_required_download_finished(self, script, download):
self._in_progress_dls.remove(download)
if not self._add_script_with_requires(script):
log.greasemonkey.debug(
"Finished download {} for script {} "
"but some requirements are still pending"
.format(download.basename, script.name))
def _add_script_with_requires(self, script, quiet=False):
"""Add a script with pending downloads to this GreasemonkeyManager.
Specifically a script that has dependancies specified via an
`@require` rule.
Args:
script: The GreasemonkeyScript to add.
quiet: True to suppress the scripts_reloaded signal after
adding `script`.
Returns: True if the script was added, False if there are still
dependancies being downloaded.
"""
# See if we are still waiting on any required scripts for this one
for dl in self._in_progress_dls:
if dl.requested_url in script.requires:
return False
# Need to add the required scripts to the IIFE now
for url in reversed(script.requires):
target_path = self._required_url_to_file_path(url)
log.greasemonkey.debug(
"Adding required script for {} to IIFE: {}"
.format(script.name, url))
with open(target_path, encoding='utf8') as f:
script.add_required_script(f.read())
self._add_script(script)
if not quiet:
self.scripts_reloaded.emit()
return True
def _get_required_scripts(self, script, force=False):
required_dls = [(url, self._required_url_to_file_path(url))
for url in script.requires]
if not force:
required_dls = [(url, path) for (url, path) in required_dls
if not os.path.exists(path)]
if not required_dls:
# All the required files exist already
self._add_script_with_requires(script, quiet=True)
return
download_manager = objreg.get('qtnetwork-download-manager')
for url, target_path in required_dls:
target = downloads.FileDownloadTarget(target_path,
force_overwrite=True)
download = download_manager.get(QUrl(url), target=target,
auto_remove=True)
download.requested_url = url
self._in_progress_dls.append(download)
if download.successful:
self._on_required_download_finished(script, download)
else:
download.finished.connect(
functools.partial(self._on_required_download_finished,
script, download))
def scripts_for(self, url):
"""Fetch scripts that are registered to run for url.
returns a tuple of lists of scripts meant to run at (document-start,
document-end, document-idle)
"""
matcher = GreasemonkeyMatcher(url)
if not matcher.is_greaseable:
return MatchingScripts(url, [], [], [])
return MatchingScripts(
url=url,
start=[script for script in self._run_start
if matcher.matches(script)],
end=[script for script in self._run_end
if matcher.matches(script)],
idle=[script for script in self._run_idle
if matcher.matches(script)]
)
def all_scripts(self):
"""Return all scripts found in the configured script directory."""
return self._run_start + self._run_end + self._run_idle
def init():
"""Initialize Greasemonkey support."""
gm_manager = GreasemonkeyManager()
objreg.register('greasemonkey', gm_manager)
try:
os.mkdir(_scripts_dir())
except FileExistsError:
pass

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
@@ -22,8 +22,10 @@
import collections
import functools
import math
import os
import re
import html
import enum
from string import ascii_lowercase
import attr
@@ -37,10 +39,9 @@ from qutebrowser.commands import userscripts, cmdexc, cmdutils, runners
from qutebrowser.utils import usertypes, log, qtutils, message, objreg, utils
Target = usertypes.enum('Target', ['normal', 'current', 'tab', 'tab_fg',
'tab_bg', 'window', 'yank', 'yank_primary',
'run', 'fill', 'hover', 'download',
'userscript', 'spawn'])
Target = enum.Enum('Target', ['normal', 'current', 'tab', 'tab_fg', 'tab_bg',
'window', 'yank', 'yank_primary', 'run', 'fill',
'hover', 'download', 'userscript', 'spawn'])
class HintingError(Exception):
@@ -154,6 +155,7 @@ class HintContext:
to_follow: The link to follow when enter is pressed.
args: Custom arguments for userscript/spawn
rapid: Whether to do rapid hinting.
first_run: Whether the action is run for the 1st time in rapid hinting.
add_history: Whether to add yanked or spawned link to the history.
filterstr: Used to save the filter string for restoring in rapid mode.
tab: The WebTab object we started hinting in.
@@ -166,12 +168,14 @@ class HintContext:
baseurl = attr.ib(None)
to_follow = attr.ib(None)
rapid = attr.ib(False)
first_run = attr.ib(True)
add_history = attr.ib(False)
filterstr = attr.ib(None)
args = attr.ib(attr.Factory(list))
tab = attr.ib(None)
group = attr.ib(None)
hint_mode = attr.ib(None)
first = attr.ib(False)
def get_args(self, urlstr):
"""Get the arguments, with {hint-url} replaced by the given URL."""
@@ -240,7 +244,18 @@ class HintActions:
if url.scheme() == 'mailto':
flags |= QUrl.RemoveScheme
urlstr = url.toString(flags)
utils.set_clipboard(urlstr, selection=sel)
new_content = urlstr
# only second and consecutive yanks are to append to the clipboard
if context.rapid and not context.first_run:
try:
old_content = utils.get_clipboard(selection=sel)
except utils.ClipboardEmptyError:
pass
else:
new_content = os.linesep.join([old_content, new_content])
utils.set_clipboard(new_content, selection=sel)
msg = "Yanked URL to {}: {}".format(
"primary selection" if sel else "clipboard",
@@ -291,8 +306,7 @@ class HintActions:
user_agent = context.tab.user_agent()
# FIXME:qtwebengine do this with QtWebEngine downloads?
download_manager = objreg.get('qtnetwork-download-manager',
scope='window', window=self._win_id)
download_manager = objreg.get('qtnetwork-download-manager')
download_manager.get(url, qnam=qnam, user_agent=user_agent,
prompt_download_directory=prompt)
@@ -390,7 +404,6 @@ class HintManager(QObject):
def _cleanup(self):
"""Clean up after hinting."""
# pylint: disable=not-an-iterable
for label in self._context.all_labels:
label.cleanup()
@@ -445,8 +458,17 @@ class HintManager(QObject):
# Short hints are the number of hints we can possibly show which are
# (needed - 1) digits in length.
if needed > min_chars:
short_count = math.floor((len(chars) ** needed - len(elems)) /
total_space = len(chars) ** needed
# Calculate short_count naively, by finding the avaiable space and
# dividing by the number of spots we would loose by adding a
# short element
short_count = math.floor((total_space - len(elems)) /
len(chars))
# Check if we double counted above to warrant another short_count
# https://github.com/qutebrowser/qutebrowser/issues/3242
if total_space - (short_count * len(chars) +
(len(elems) - short_count)) >= len(chars) - 1:
short_count += 1
else:
short_count = 0
@@ -605,22 +627,30 @@ class HintManager(QObject):
modeman.enter(self._win_id, usertypes.KeyMode.hint,
'HintManager.start')
if self._context.first:
self._fire(strings[0])
return
# to make auto_follow == 'always' work
self._handle_auto_follow()
@cmdutils.register(instance='hintmanager', scope='tab', name='hint',
star_args_optional=True, maxsplit=2)
@cmdutils.argument('win_id', win_id=True)
def start(self, rapid=False, group=webelem.Group.all, target=Target.normal,
*args, win_id, mode=None, add_history=False):
def start(self, # pylint: disable=keyword-arg-before-vararg
group=webelem.Group.all, target=Target.normal,
*args, win_id, mode=None, add_history=False, rapid=False,
first=False):
"""Start hinting.
Args:
rapid: Whether to do rapid hinting. This is only possible with
targets `tab` (with `tabs.background_tabs=true`), `tab-bg`,
rapid: Whether to do rapid hinting. With rapid hinting, the hint
mode isn't left after a hint is followed, so you can easily
open multiple links. This is only possible with targets
`tab` (with `tabs.background_tabs=true`), `tab-bg`,
`window`, `run`, `hover`, `userscript` and `spawn`.
add_history: Whether to add the spawned or yanked link to the
browsing history.
first: Click the first hinted element without prompting.
group: The element types to hint.
- `all`: All clickable elements.
@@ -672,7 +702,7 @@ class HintManager(QObject):
"""
tabbed_browser = objreg.get('tabbed-browser', scope='window',
window=self._win_id)
tab = tabbed_browser.currentWidget()
tab = tabbed_browser.widget.currentWidget()
if tab is None:
raise cmdexc.CommandError("No WebView available yet!")
@@ -684,7 +714,8 @@ class HintManager(QObject):
if rapid:
if target in [Target.tab_bg, Target.window, Target.run,
Target.hover, Target.userscript, Target.spawn,
Target.download, Target.normal, Target.current]:
Target.download, Target.normal, Target.current,
Target.yank, Target.yank_primary]:
pass
elif target == Target.tab and config.val.tabs.background:
pass
@@ -703,6 +734,7 @@ class HintManager(QObject):
self._context.rapid = rapid
self._context.hint_mode = mode
self._context.add_history = add_history
self._context.first = first
try:
self._context.baseurl = tabbed_browser.current_url()
except qtutils.QtValueError:
@@ -797,7 +829,6 @@ class HintManager(QObject):
log.hints.debug("Filtering hints on {!r}".format(filterstr))
visible = []
# pylint: disable=not-an-iterable
for label in self._context.all_labels:
try:
if self._filter_matches(filterstr, str(label.elem)):
@@ -898,22 +929,32 @@ class HintManager(QObject):
except HintingError as e:
message.error(str(e))
@cmdutils.register(instance='hintmanager', scope='tab', hide=True,
if self._context is not None:
self._context.first_run = False
@cmdutils.register(instance='hintmanager', scope='tab',
modes=[usertypes.KeyMode.hint])
def follow_hint(self, keystring=None):
def follow_hint(self, select=False, keystring=None):
"""Follow a hint.
Args:
select: Only select the given hint, don't necessarily follow it.
keystring: The hint to follow, or None.
"""
if keystring is None:
if self._context.to_follow is None:
raise cmdexc.CommandError("No hint to follow")
elif select:
raise cmdexc.CommandError("Can't use --select without hint.")
else:
keystring = self._context.to_follow
elif keystring not in self._context.labels:
raise cmdexc.CommandError("No hint {}!".format(keystring))
self._fire(keystring)
if select:
self.handle_partial_key(keystring)
else:
self._fire(keystring)
@pyqtSlot(usertypes.KeyMode)
def on_mode_left(self, mode):

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2015-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
@@ -21,8 +21,9 @@
import os
import time
import contextlib
from PyQt5.QtCore import pyqtSlot, QUrl, QTimer
from PyQt5.QtCore import pyqtSlot, QUrl, QTimer, pyqtSignal
from qutebrowser.commands import cmdutils, cmdexc
from qutebrowser.utils import (utils, objreg, log, usertypes, message,
@@ -31,7 +32,7 @@ from qutebrowser.misc import objects, sql
# increment to indicate that HistoryCompletion must be regenerated
_USER_VERSION = 1
_USER_VERSION = 2
class CompletionHistory(sql.SqlTable):
@@ -51,6 +52,11 @@ class WebHistory(sql.SqlTable):
"""The global history of visited pages."""
# All web history cleared
history_cleared = pyqtSignal()
# one url cleared
url_cleared = pyqtSignal(QUrl)
def __init__(self, parent=None):
super().__init__("History", ['url', 'title', 'atime', 'redirect'],
constraints={'url': 'NOT NULL',
@@ -87,11 +93,22 @@ class WebHistory(sql.SqlTable):
def __contains__(self, url):
return self._contains_query.run(val=url).value()
@contextlib.contextmanager
def _handle_sql_errors(self):
try:
yield
except sql.SqlError as e:
if e.environmental:
message.error("Failed to write history: {}".format(e.text()))
else:
raise
def _rebuild_completion(self):
data = {'url': [], 'title': [], 'last_atime': []}
# select the latest entry for each url
q = sql.Query('SELECT url, title, max(atime) AS atime FROM History '
'WHERE NOT redirect GROUP BY url ORDER BY atime asc')
'WHERE NOT redirect and url NOT LIKE "qute://back%" '
'GROUP BY url ORDER BY atime asc')
for entry in q.run():
data['url'].append(self._format_completion_url(QUrl(entry.url)))
data['title'].append(entry.title)
@@ -138,12 +155,14 @@ class WebHistory(sql.SqlTable):
if force:
self._do_clear()
else:
message.confirm_async(self._do_clear, title="Clear all browsing "
"history?")
message.confirm_async(yes_action=self._do_clear,
title="Clear all browsing history?")
def _do_clear(self):
self.delete_all()
self.completion.delete_all()
with self._handle_sql_errors():
self.delete_all()
self.completion.delete_all()
self.history_cleared.emit()
def delete_url(self, url):
"""Remove all history entries with the given url.
@@ -155,11 +174,14 @@ class WebHistory(sql.SqlTable):
qtutils.ensure_valid(qurl)
self.delete('url', self._format_url(qurl))
self.completion.delete('url', self._format_completion_url(qurl))
self.url_cleared.emit(qurl)
@pyqtSlot(QUrl, QUrl, str)
def add_from_tab(self, url, requested_url, title):
"""Add a new history entry as slot, called from a BrowserTab."""
if url.scheme() == 'data' or requested_url.scheme() == 'data':
if any(url.scheme() in ('data', 'view-source') or
(url.scheme(), url.host()) == ('qute', 'back')
for url in (url, requested_url)):
return
if url.isEmpty():
# things set via setHtml
@@ -191,7 +213,7 @@ class WebHistory(sql.SqlTable):
atime = int(atime) if (atime is not None) else int(time.time())
try:
with self._handle_sql_errors():
self.insert({'url': self._format_url(url),
'title': title,
'atime': atime,
@@ -202,11 +224,6 @@ class WebHistory(sql.SqlTable):
'title': title,
'last_atime': atime
}, replace=True)
except sql.SqlError as e:
if e.environmental:
message.error("Failed to write history: {}".format(e.text()))
else:
raise
def _parse_entry(self, line):
"""Parse a history line like '12345 http://example.com title'."""
@@ -261,6 +278,7 @@ class WebHistory(sql.SqlTable):
return
def action():
"""Actually run the import."""
with debug.log_time(log.init, 'Import old history file to sqlite'):
try:
self._read(path)
@@ -333,7 +351,7 @@ class WebHistory(sql.SqlTable):
f.write('\n'.join(lines))
message.info("Dumped history to {}".format(dest))
except OSError as e:
raise cmdexc.CommandError('Could not write history: {}', e)
raise cmdexc.CommandError('Could not write history: {}'.format(e))
def init(parent=None):

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2015-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
@@ -87,6 +87,8 @@ class AbstractWebInspector(QWidget):
data = bytes(self.saveGeometry())
geom = base64.b64encode(data).decode('ASCII')
configfiles.state['geometry']['inspector'] = geom
self.inspect(None)
super().closeEvent(e)
def inspect(self, page):
@@ -94,7 +96,9 @@ class AbstractWebInspector(QWidget):
raise NotImplementedError
def toggle(self, page):
"""Show/hide the inspector."""
if self._widget.isVisible():
self.hide()
else:
self.inspect(page)
self.show()

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
@@ -19,15 +19,13 @@
"""Mouse handling for a browser tab."""
from PyQt5.QtCore import QObject, QEvent, Qt, QTimer
from qutebrowser.config import config
from qutebrowser.utils import message, log, usertypes
from qutebrowser.utils import message, log, usertypes, qtutils, objreg
from qutebrowser.keyinput import modeman
from PyQt5.QtCore import QObject, QEvent, Qt, QTimer
class ChildEventFilter(QObject):
"""An event filter re-adding MouseEventFilter on ChildEvent.
@@ -42,11 +40,12 @@ class ChildEventFilter(QObject):
_widget: The widget expected to send out childEvents.
"""
def __init__(self, eventfilter, widget, parent=None):
def __init__(self, eventfilter, widget, win_id, parent=None):
super().__init__(parent)
self._filter = eventfilter
assert widget is not None
self._widget = widget
self._win_id = win_id
def eventFilter(self, obj, event):
"""Act on ChildAdded events."""
@@ -56,6 +55,29 @@ class ChildEventFilter(QObject):
obj, child))
assert obj is self._widget
child.installEventFilter(self._filter)
if qtutils.version_check('5.11', compiled=False, exact=True):
# WORKAROUND for https://bugreports.qt.io/browse/QTBUG-68076
pass_modes = [usertypes.KeyMode.command,
usertypes.KeyMode.prompt,
usertypes.KeyMode.yesno]
if modeman.instance(self._win_id).mode not in pass_modes:
tabbed_browser = objreg.get('tabbed-browser',
scope='window',
window=self._win_id)
current_index = tabbed_browser.widget.currentIndex()
try:
widget_index = tabbed_browser.widget.indexOf(
self._widget.parent())
except RuntimeError:
widget_index = -1
if current_index == widget_index:
QTimer.singleShot(0, self._widget.setFocus)
elif event.type() == QEvent.ChildRemoved:
child = event.child()
log.mouse.debug("{}: removed child {}".format(obj, child))
return False
@@ -153,8 +175,9 @@ class MouseEventFilter(QObject):
if elem.is_editable():
log.mouse.debug("Clicked editable element!")
modeman.enter(self._tab.win_id, usertypes.KeyMode.insert,
'click', only_if_normal=True)
if config.val.input.insert_mode.auto_enter:
modeman.enter(self._tab.win_id, usertypes.KeyMode.insert,
'click', only_if_normal=True)
else:
log.mouse.debug("Clicked non-editable element!")
if config.val.input.insert_mode.auto_leave:

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
@@ -64,6 +64,7 @@ def path_up(url, count):
raise Error("Can't go up!")
for _i in range(0, min(count, path.count('/'))):
path = posixpath.join(path, posixpath.pardir)
path = posixpath.normpath(path)
url.setPath(path)
return url

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
@@ -59,6 +59,7 @@ def _js_slot(*args):
def _decorator(method):
@functools.wraps(method)
def new_method(self, *args, **kwargs):
"""Call the underlying function."""
try:
return method(self, *args, **kwargs)
except:

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
@@ -34,6 +34,10 @@ def init():
QNetworkProxyFactory.setApplicationProxyFactory(proxy_factory)
def shutdown():
QNetworkProxyFactory.setApplicationProxyFactory(None)
class ProxyFactory(QNetworkProxyFactory):
"""Factory for proxies to be used by qutebrowser."""
@@ -61,6 +65,9 @@ class ProxyFactory(QNetworkProxyFactory):
"""
proxy = config.val.content.proxy
if proxy is configtypes.SYSTEM_PROXY:
# On Linux, use "export http_proxy=socks5://host:port" to manually
# set system proxy.
# ref. http://doc.qt.io/qt-5/qnetworkproxyfactory.html#systemProxyForQuery
proxies = QNetworkProxyFactory.systemProxyForQuery(query)
elif isinstance(proxy, pac.PACFetcher):
proxies = proxy.resolve(query)

View File

@@ -1,7 +1,7 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015 Daniel Schadt
# Copyright 2016-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
@@ -82,7 +82,7 @@ def fix_urls(asset):
('viewer.css', 'qute://pdfjs/web/viewer.css'),
('compatibility.js', 'qute://pdfjs/web/compatibility.js'),
('locale/locale.properties',
'qute://pdfjs/web/locale/locale.properties'),
'qute://pdfjs/web/locale/locale.properties'),
('l10n.js', 'qute://pdfjs/web/l10n.js'),
('../build/pdf.js', 'qute://pdfjs/build/pdf.js'),
('debugger.js', 'qute://pdfjs/web/debugger.js'),

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
@@ -20,6 +20,7 @@
"""Download manager."""
import io
import os.path
import shutil
import functools
@@ -28,7 +29,7 @@ from PyQt5.QtCore import pyqtSlot, pyqtSignal, QTimer
from PyQt5.QtNetwork import QNetworkRequest, QNetworkReply
from qutebrowser.config import config
from qutebrowser.utils import message, usertypes, log, urlutils, utils
from qutebrowser.utils import message, usertypes, log, urlutils, utils, debug
from qutebrowser.browser import downloads
from qutebrowser.browser.webkit import http
from qutebrowser.browser.webkit.network import networkmanager
@@ -161,6 +162,7 @@ class DownloadItem(downloads.AbstractDownloadItem):
QTimer.singleShot(0, lambda: self._die(reply.errorString()))
def _do_cancel(self):
self._read_timer.stop()
if self._reply is not None:
self._reply.finished.disconnect(self._on_reply_finished)
self._reply.abort()
@@ -198,13 +200,26 @@ class DownloadItem(downloads.AbstractDownloadItem):
def _ask_confirm_question(self, title, msg):
no_action = functools.partial(self.cancel, remove_data=False)
url = 'file://{}'.format(self._filename)
message.confirm_async(title=title, text=msg,
yes_action=self._after_set_filename,
no_action=no_action, cancel_action=no_action,
abort_on=[self.cancelled, self.error])
abort_on=[self.cancelled, self.error], url=url)
def _ask_create_parent_question(self, title, msg,
force_overwrite, remember_directory):
no_action = functools.partial(self.cancel, remove_data=False)
url = 'file://{}'.format(os.path.dirname(self._filename))
message.confirm_async(title=title, text=msg,
yes_action=(lambda:
self._after_create_parent_question(
force_overwrite,
remember_directory)),
no_action=no_action, cancel_action=no_action,
abort_on=[self.cancelled, self.error], url=url)
def _set_fileobj(self, fileobj, *, autoclose=True):
""""Set the file object to write the download to.
"""Set the file object to write the download to.
Args:
fileobj: A file-like object.
@@ -292,8 +307,14 @@ class DownloadItem(downloads.AbstractDownloadItem):
"""Handle QNetworkReply errors."""
if code == QNetworkReply.OperationCanceledError:
return
if self._reply is None:
error = "Unknown error: {}".format(
debug.qenum_key(QNetworkReply, code))
else:
self._die(self._reply.errorString())
error = self._reply.errorString()
self._die(error)
@pyqtSlot()
def _on_read_timer_timeout(self):
@@ -368,10 +389,10 @@ class DownloadManager(downloads.AbstractDownloadManager):
_networkmanager: A NetworkManager for generic downloads.
"""
def __init__(self, win_id, parent=None):
def __init__(self, parent=None):
super().__init__(parent)
self._networkmanager = networkmanager.NetworkManager(
win_id=win_id, tab_id=None,
win_id=None, tab_id=None,
private=config.val.content.private_browsing, parent=self)
@pyqtSlot('QUrl')
@@ -388,7 +409,7 @@ class DownloadManager(downloads.AbstractDownloadManager):
"""
if not url.isValid():
urlutils.invalid_url_error(url, "start download")
return
return None
req = QNetworkRequest(url)
if user_agent is not None:
req.setHeader(QNetworkRequest.UserAgentHeader, user_agent)

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
@@ -24,23 +24,28 @@ Module attributes:
_HANDLERS: The handlers registered via decorators.
"""
import html
import json
import os
import time
import urllib.parse
import textwrap
import pkg_resources
import mimetypes
import urllib
import collections
import pkg_resources
from PyQt5.QtCore import QUrlQuery, QUrl
import qutebrowser
from qutebrowser.config import config, configdata, configexc, configdiff
from qutebrowser.utils import (version, utils, jinja, log, message, docutils,
objreg)
objreg, urlutils)
from qutebrowser.misc import objects
from qutebrowser.qt import sip
pyeval_output = ":pyeval was never called"
spawn_output = ":spawn was never called"
_HANDLERS = {}
@@ -91,7 +96,7 @@ class Redirect(Exception):
self.url = url
class add_handler: # pylint: disable=invalid-name
class add_handler: # noqa: N801,N806 pylint: disable=invalid-name
"""Decorator to register a qute://* URL handler.
@@ -111,6 +116,7 @@ class add_handler: # pylint: disable=invalid-name
return function
def wrapper(self, *args, **kwargs):
"""Call the underlying function."""
if self._backend is not None and objects.backend != self._backend:
return self.wrong_backend_handler(*args, **kwargs)
else:
@@ -118,12 +124,12 @@ class add_handler: # pylint: disable=invalid-name
def wrong_backend_handler(self, url):
"""Show an error page about using the invalid backend."""
html = jinja.render('error.html',
title="Error while opening qute://url",
url=url.toDisplayString(),
error='{} is not available with this '
'backend'.format(url.toDisplayString()))
return 'text/html', html
src = jinja.render('error.html',
title="Error while opening qute://url",
url=url.toDisplayString(),
error='{} is not available with this '
'backend'.format(url.toDisplayString()))
return 'text/html', src
def data_for_url(url):
@@ -135,16 +141,30 @@ def data_for_url(url):
Return:
A (mimetype, data) tuple.
"""
norm_url = url.adjusted(QUrl.NormalizePathSegments |
QUrl.StripTrailingSlash)
if norm_url != url:
raise Redirect(norm_url)
path = url.path()
host = url.host()
query = urlutils.query_string(url)
# A url like "qute:foo" is split as "scheme:path", not "scheme:host".
log.misc.debug("url: {}, path: {}, host {}".format(
url.toDisplayString(), path, host))
if path and not host:
if not path or not host:
new_url = QUrl()
new_url.setScheme('qute')
new_url.setHost(path)
# When path is absent, e.g. qute://help (with no trailing slash)
if host:
new_url.setHost(host)
# When host is absent, e.g. qute:help
else:
new_url.setHost(path)
new_url.setPath('/')
if query:
new_url.setQuery(query)
if new_url.host(): # path was a valid host
raise Redirect(new_url)
@@ -158,7 +178,7 @@ def data_for_url(url):
except OSError as e:
# FIXME:qtwebengine how to handle this?
raise QuteSchemeOSError(e)
except QuteSchemeError as e:
except QuteSchemeError:
raise
assert mimetype is not None, url
@@ -177,11 +197,32 @@ def qute_bookmarks(_url):
quickmarks = sorted(objreg.get('quickmark-manager').marks.items(),
key=lambda x: x[0]) # Sort by name
html = jinja.render('bookmarks.html',
title='Bookmarks',
bookmarks=bookmarks,
quickmarks=quickmarks)
return 'text/html', html
src = jinja.render('bookmarks.html',
title='Bookmarks',
bookmarks=bookmarks,
quickmarks=quickmarks)
return 'text/html', src
@add_handler('tabs')
def qute_tabs(_url):
"""Handler for qute://tabs. Display information about all open tabs."""
tabs = collections.defaultdict(list)
for win_id, window in objreg.window_registry.items():
if sip.isdeleted(window):
continue
tabbed_browser = objreg.get('tabbed-browser',
scope='window',
window=win_id)
for tab in tabbed_browser.widgets():
if tab.url() not in [QUrl("qute://tabs/"), QUrl("qute://tabs")]:
urlstr = tab.url().toDisplayString()
tabs[str(win_id)].append((tab.title(), urlstr))
src = jinja.render('tabs.html',
title='Tabs',
tab_list_by_window=tabs)
return 'text/html', src
def history_data(start_time, offset=None):
@@ -201,8 +242,9 @@ def history_data(start_time, offset=None):
end_time = start_time - 24*60*60
entries = hist.entries_between(end_time, start_time)
return [{"url": e.url, "title": e.title or e.url, "time": e.atime}
for e in entries]
return [{"url": e.url,
"title": html.escape(e.title) or html.escape(e.url),
"time": e.atime} for e in entries]
@add_handler('history')
@@ -223,8 +265,6 @@ def qute_history(url):
return 'text/html', json.dumps(history_data(start_time, offset))
else:
if not config.val.content.javascript.enabled:
return 'text/plain', b'JavaScript is required for qute://history'
return 'text/html', jinja.render(
'history.html',
title='History',
@@ -249,18 +289,25 @@ def qute_javascript(url):
@add_handler('pyeval')
def qute_pyeval(_url):
"""Handler for qute://pyeval."""
html = jinja.render('pre.html', title='pyeval', content=pyeval_output)
return 'text/html', html
src = jinja.render('pre.html', title='pyeval', content=pyeval_output)
return 'text/html', src
@add_handler('spawn-output')
def qute_spawn_output(_url):
"""Handler for qute://spawn-output."""
src = jinja.render('pre.html', title='spawn output', content=spawn_output)
return 'text/html', src
@add_handler('version')
@add_handler('verizon')
def qute_version(_url):
"""Handler for qute://version."""
html = jinja.render('version.html', title='Version info',
version=version.version(),
copyright=qutebrowser.__copyright__)
return 'text/html', html
src = jinja.render('version.html', title='Version info',
version=version.version(),
copyright=qutebrowser.__copyright__)
return 'text/html', src
@add_handler('plainlog')
@@ -274,13 +321,12 @@ def qute_plainlog(url):
if log.ram_handler is None:
text = "Log output was disabled."
else:
try:
level = urllib.parse.parse_qs(url.query())['level'][0]
except KeyError:
level = QUrlQuery(url).queryItemValue('level')
if not level:
level = 'vdebug'
text = log.ram_handler.dump_log(html=False, level=level)
html = jinja.render('pre.html', title='log', content=text)
return 'text/html', html
src = jinja.render('pre.html', title='log', content=text)
return 'text/html', src
@add_handler('log')
@@ -294,20 +340,19 @@ def qute_log(url):
if log.ram_handler is None:
html_log = None
else:
try:
level = urllib.parse.parse_qs(url.query())['level'][0]
except KeyError:
level = QUrlQuery(url).queryItemValue('level')
if not level:
level = 'vdebug'
html_log = log.ram_handler.dump_log(html=True, level=level)
html = jinja.render('log.html', title='log', content=html_log)
return 'text/html', html
src = jinja.render('log.html', title='log', content=html_log)
return 'text/html', src
@add_handler('gpl')
def qute_gpl(_url):
"""Handler for qute://gpl. Return HTML content as string."""
return 'text/html', utils.read_file('html/LICENSE.html')
return 'text/html', utils.read_file('html/license.html')
@add_handler('help')
@@ -323,8 +368,14 @@ def qute_help(url):
"scripts/asciidoc2html.py.")
path = 'html/doc/{}'.format(urlpath)
if urlpath.endswith('.png'):
return 'image/png', utils.read_file(path, binary=True)
if not urlpath.endswith('.html'):
try:
bdata = utils.read_file(path, binary=True)
except OSError as e:
raise QuteSchemeOSError(e)
mimetype, _encoding = mimetypes.guess_type(urlpath)
assert mimetype is not None, url
return mimetype, bdata
try:
data = utils.read_file(path)
@@ -366,12 +417,12 @@ def qute_help(url):
@add_handler('backend-warning')
def qute_backend_warning(_url):
"""Handler for qute://backend-warning."""
html = jinja.render('backend-warning.html',
distribution=version.distribution(),
Distribution=version.Distribution,
version=pkg_resources.parse_version,
title="Legacy backend warning")
return 'text/html', html
src = jinja.render('backend-warning.html',
distribution=version.distribution(),
Distribution=version.Distribution,
version=pkg_resources.parse_version,
title="Legacy backend warning")
return 'text/html', src
def _qute_settings_set(url):
@@ -401,10 +452,38 @@ def qute_settings(url):
if url.path() == '/set':
return _qute_settings_set(url)
html = jinja.render('settings.html', title='settings',
configdata=configdata,
confget=config.instance.get_str)
return 'text/html', html
src = jinja.render('settings.html', title='settings',
configdata=configdata,
confget=config.instance.get_str)
return 'text/html', src
@add_handler('bindings')
def qute_bindings(_url):
"""Handler for qute://bindings. View keybindings."""
bindings = {}
defaults = config.val.bindings.default
modes = set(defaults.keys()).union(config.val.bindings.commands)
modes.remove('normal')
modes = ['normal'] + sorted(list(modes))
for mode in modes:
bindings[mode] = config.key_instance.get_bindings_for(mode)
src = jinja.render('bindings.html', title='Bindings',
bindings=bindings)
return 'text/html', src
@add_handler('back')
def qute_back(url):
"""Handler for qute://back.
Simple page to free ram / lazy load a site, goes back on focusing the tab.
"""
src = jinja.render(
'back.html',
title='Suspended: ' + urllib.parse.unquote(url.fragment()))
return 'text/html', src
@add_handler('configdiff')
@@ -415,8 +494,15 @@ def qute_configdiff(url):
return 'text/html', configdiff.get_diff()
except OSError as e:
error = (b'Failed to read old config: ' +
str(e.strerror).encode('utf-8'))
str(e.strerror).encode('utf-8'))
return 'text/plain', error
else:
data = config.instance.dump_userconfig().encode('utf-8')
return 'text/plain', data
@add_handler('pastebin-version')
def qute_pastebin_version(_url):
"""Handler that pastebins the version string."""
version.pastebin_version()
return 'text/plain', b'Paste called.'

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
@@ -19,33 +19,37 @@
"""Various utilities shared between webpage/webview subclasses."""
import os
import html
import netrc
from PyQt5.QtCore import QUrl
from qutebrowser.config import config
from qutebrowser.utils import usertypes, message, log, objreg, jinja
from qutebrowser.utils import usertypes, message, log, objreg, jinja, utils
from qutebrowser.mainwindow import mainwindow
class CallSuper(Exception):
"""Raised when the caller should call the superclass instead."""
def custom_headers():
def custom_headers(url):
"""Get the combined custom headers."""
headers = {}
dnt_config = config.val.content.headers.do_not_track
dnt_config = config.instance.get('content.headers.do_not_track', url=url)
if dnt_config is not None:
dnt = b'1' if dnt_config else b'0'
headers[b'DNT'] = dnt
headers[b'X-Do-Not-Track'] = dnt
conf_headers = config.val.content.headers.custom
conf_headers = config.instance.get('content.headers.custom', url=url)
for header, value in conf_headers.items():
headers[header.encode('ascii')] = value.encode('ascii')
accept_language = config.val.content.headers.accept_language
accept_language = config.instance.get('content.headers.accept_language',
url=url)
if accept_language is not None:
headers[b'Accept-Language'] = accept_language.encode('ascii')
@@ -61,30 +65,33 @@ def authentication_required(url, authenticator, abort_on):
else:
msg = '<b>{}</b> needs authentication'.format(
html.escape(url.toDisplayString()))
urlstr = url.toString(QUrl.RemovePassword | QUrl.FullyEncoded)
answer = message.ask(title="Authentication required", text=msg,
mode=usertypes.PromptMode.user_pwd,
abort_on=abort_on)
abort_on=abort_on, url=urlstr)
if answer is not None:
authenticator.setUser(answer.user)
authenticator.setPassword(answer.password)
return answer
def javascript_confirm(url, js_msg, abort_on):
def javascript_confirm(url, js_msg, abort_on, *, escape_msg=True):
"""Display a javascript confirm prompt."""
log.js.debug("confirm: {}".format(js_msg))
if config.val.content.javascript.modal_dialog:
raise CallSuper
js_msg = html.escape(js_msg) if escape_msg else js_msg
msg = 'From <b>{}</b>:<br/>{}'.format(html.escape(url.toDisplayString()),
html.escape(js_msg))
js_msg)
urlstr = url.toString(QUrl.RemovePassword | QUrl.FullyEncoded)
ans = message.ask('Javascript confirm', msg,
mode=usertypes.PromptMode.yesno,
abort_on=abort_on)
abort_on=abort_on, url=urlstr)
return bool(ans)
def javascript_prompt(url, js_msg, default, abort_on):
def javascript_prompt(url, js_msg, default, abort_on, *, escape_msg=True):
"""Display a javascript prompt."""
log.js.debug("prompt: {}".format(js_msg))
if config.val.content.javascript.modal_dialog:
@@ -92,12 +99,14 @@ def javascript_prompt(url, js_msg, default, abort_on):
if not config.val.content.javascript.prompt:
return (False, "")
js_msg = html.escape(js_msg) if escape_msg else js_msg
msg = '<b>{}</b> asks:<br/>{}'.format(html.escape(url.toDisplayString()),
html.escape(js_msg))
js_msg)
urlstr = url.toString(QUrl.RemovePassword | QUrl.FullyEncoded)
answer = message.ask('Javascript prompt', msg,
mode=usertypes.PromptMode.text,
default=default,
abort_on=abort_on)
abort_on=abort_on, url=urlstr)
if answer is None:
return (False, "")
@@ -105,7 +114,7 @@ def javascript_prompt(url, js_msg, default, abort_on):
return (True, answer)
def javascript_alert(url, js_msg, abort_on):
def javascript_alert(url, js_msg, abort_on, *, escape_msg=True):
"""Display a javascript alert."""
log.js.debug("alert: {}".format(js_msg))
if config.val.content.javascript.modal_dialog:
@@ -114,10 +123,12 @@ def javascript_alert(url, js_msg, abort_on):
if not config.val.content.javascript.alert:
return
js_msg = html.escape(js_msg) if escape_msg else js_msg
msg = 'From <b>{}</b>:<br/>{}'.format(html.escape(url.toDisplayString()),
html.escape(js_msg))
js_msg)
urlstr = url.toString(QUrl.RemovePassword | QUrl.FullyEncoded)
message.ask('Javascript alert', msg, mode=usertypes.PromptMode.alert,
abort_on=abort_on)
abort_on=abort_on, url=urlstr)
def javascript_log_message(level, source, line, msg):
@@ -146,7 +157,7 @@ def ignore_certificate_errors(url, errors, abort_on):
Return:
True if the error should be ignored, False otherwise.
"""
ssl_strict = config.val.content.ssl_strict
ssl_strict = config.instance.get('content.ssl_strict', url=url)
log.webview.debug("Certificate errors {!r}, strict {}".format(
errors, ssl_strict))
@@ -164,9 +175,10 @@ def ignore_certificate_errors(url, errors, abort_on):
""".strip())
msg = err_template.render(url=url, errors=errors)
urlstr = url.toString(QUrl.RemovePassword | QUrl.FullyEncoded)
ignore = message.ask(title="Certificate errors - continue?", text=msg,
mode=usertypes.PromptMode.yesno, default=False,
abort_on=abort_on)
abort_on=abort_on, url=urlstr)
if ignore is None:
# prompt aborted
ignore = False
@@ -182,10 +194,11 @@ def ignore_certificate_errors(url, errors, abort_on):
return False
else:
raise ValueError("Invalid ssl_strict value {!r}".format(ssl_strict))
raise AssertionError("Not reached")
raise utils.Unreachable
def feature_permission(url, option, msg, yes_action, no_action, abort_on):
def feature_permission(url, option, msg, yes_action, no_action, abort_on,
blocking=False):
"""Handle a feature permission request.
Args:
@@ -195,22 +208,36 @@ def feature_permission(url, option, msg, yes_action, no_action, abort_on):
yes_action: A callable to call if the request was approved
no_action: A callable to call if the request was denied
abort_on: A list of signals which interrupt the question.
blocking: If True, ask a blocking question.
Return:
The Question object if a question was asked, None otherwise.
The Question object if a question was asked (and blocking=False),
None otherwise.
"""
config_val = config.instance.get(option)
config_val = config.instance.get(option, url=url)
if config_val == 'ask':
if url.isValid():
urlstr = url.toString(QUrl.RemovePassword | QUrl.FullyEncoded)
text = "Allow the website at <b>{}</b> to {}?".format(
html.escape(url.toDisplayString()), msg)
else:
urlstr = None
text = "Allow the website to {}?".format(msg)
return message.confirm_async(
yes_action=yes_action, no_action=no_action,
cancel_action=no_action, abort_on=abort_on,
title='Permission request', text=text)
if blocking:
answer = message.ask(abort_on=abort_on, title='Permission request',
text=text, url=urlstr,
mode=usertypes.PromptMode.yesno)
if answer:
yes_action()
else:
no_action()
return None
else:
return message.confirm_async(
yes_action=yes_action, no_action=no_action,
cancel_action=no_action, abort_on=abort_on,
title='Permission request', text=text, url=urlstr)
elif config_val:
yes_action()
return None
@@ -260,3 +287,41 @@ def get_user_stylesheet():
css += '\nhtml > ::-webkit-scrollbar { width: 0px; height: 0px; }'
return css
def netrc_authentication(url, authenticator):
"""Perform authorization using netrc.
Args:
url: The URL the request was done for.
authenticator: QAuthenticator object used to set credentials provided.
Return:
True if netrc found credentials for the URL.
False otherwise.
"""
if 'HOME' not in os.environ:
# We'll get an OSError by netrc if 'HOME' isn't available in
# os.environ. We don't want to log that, so we prevent it
# altogether.
return False
user, password = None, None
try:
net = netrc.netrc(config.val.content.netrc_file)
authenticators = net.authenticators(url.host())
if authenticators is not None:
(user, _account, password) = authenticators
except FileNotFoundError:
log.misc.debug("No .netrc file found")
except OSError as e:
log.misc.exception("Unable to read the netrc file: {}".format(e))
except netrc.NetrcParseError as e:
log.misc.exception("Error when parsing the netrc file: {}".format(e))
if user is None:
return False
authenticator.setUser(user)
authenticator.setPassword(password)
return True

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
@@ -76,11 +76,11 @@ class SignalFilter(QObject):
tabbed_browser = objreg.get('tabbed-browser', scope='window',
window=self._win_id)
try:
tabidx = tabbed_browser.indexOf(tab)
tabidx = tabbed_browser.widget.indexOf(tab)
except RuntimeError:
# The tab has been deleted already
return
if tabidx == tabbed_browser.currentIndex():
if tabidx == tabbed_browser.widget.currentIndex():
if log_signal:
log.signals.debug("emitting: {} (tab {})".format(
debug.dbg_signal(signal, args), tabidx))

View File

@@ -1,7 +1,7 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2015-2017 Antoni Boucher <bouanto@zoho.com>
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2015-2018 Antoni Boucher <bouanto@zoho.com>
#
# This file is part of qutebrowser.
#
@@ -26,8 +26,8 @@ to a file on shutdown, so it makes sense to keep them as strings here.
"""
import os
import html
import os.path
import html
import functools
import collections
@@ -161,7 +161,7 @@ class QuickmarkManager(UrlMarkManager):
"Add quickmark:", usertypes.PromptMode.text,
functools.partial(self.quickmark_add, urlstr),
text="Please enter a quickmark name for<br/><b>{}</b>".format(
html.escape(url.toDisplayString())))
html.escape(url.toDisplayString())), url=urlstr)
@cmdutils.register(instance='quickmark-manager')
def quickmark_add(self, url, name):
@@ -192,7 +192,7 @@ class QuickmarkManager(UrlMarkManager):
if name in self.marks:
message.confirm_async(
title="Override existing quickmark?",
yes_action=set_mark, default=True)
yes_action=set_mark, default=True, url=url)
else:
set_mark()
@@ -280,7 +280,7 @@ class BookmarkManager(UrlMarkManager):
if urlstr in self.marks:
if toggle:
del self.marks[urlstr]
self.delete(urlstr)
return False
else:
raise AlreadyExistsError("Bookmark already exists!")

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
@@ -24,6 +24,7 @@ Module attributes:
SELECTORS: CSS selectors for different groups of elements.
"""
import enum
import collections.abc
from PyQt5.QtCore import QUrl, Qt, QEvent, QTimer
@@ -35,13 +36,15 @@ from qutebrowser.mainwindow import mainwindow
from qutebrowser.utils import log, usertypes, utils, qtutils, objreg
Group = usertypes.enum('Group', ['all', 'links', 'images', 'url', 'inputs'])
Group = enum.Enum('Group', ['all', 'links', 'images', 'url', 'inputs'])
SELECTORS = {
Group.all: ('a, area, textarea, select, input:not([type=hidden]), button, '
'frame, iframe, link, [onclick], [onmousedown], [role=link], '
'[role=option], [role=button], img'),
'frame, iframe, link, summary, [onclick], [onmousedown], '
'[role=link], [role=option], [role=button], img, '
# Angular 1 selectors
'[ng-click], [ngClick], [data-ng-click], [x-ng-click]'),
Group.links: 'a[href], area[href], link[href], [role=link][href]',
Group.images: 'img',
Group.url: '[src], [href]',
@@ -59,6 +62,13 @@ class Error(Exception):
pass
class OrphanedError(Error):
"""Raised when a webelement's parent has vanished."""
pass
class AbstractWebElement(collections.abc.MutableMapping):
"""A wrapper around QtWebKit/QtWebEngine web element.
@@ -220,7 +230,7 @@ class AbstractWebElement(collections.abc.MutableMapping):
}
relevant_classes = classes[self.tag_name()]
for klass in self.classes():
if any([klass.strip().startswith(e) for e in relevant_classes]):
if any(klass.strip().startswith(e) for e in relevant_classes):
return True
return False
@@ -297,6 +307,10 @@ class AbstractWebElement(collections.abc.MutableMapping):
href_tags = ['a', 'area', 'link']
return self.tag_name() in href_tags and 'href' in self
def _requires_user_interaction(self):
"""Return True if clicking this element needs user interaction."""
raise NotImplementedError
def _mouse_pos(self):
"""Get the position to click/hover."""
# Click the center of the largest square fitting into the top/left
@@ -395,14 +409,15 @@ class AbstractWebElement(collections.abc.MutableMapping):
return
if click_target == usertypes.ClickTarget.normal:
if self.is_link():
if self.is_link() and not self._requires_user_interaction():
log.webelem.debug("Clicking via JS click()")
self._click_js(click_target)
elif self.is_editable(strict=True):
log.webelem.debug("Clicking via JS focus()")
self._click_editable(click_target)
modeman.enter(self._tab.win_id, usertypes.KeyMode.insert,
'clicking input')
if config.val.input.insert_mode.auto_enter:
modeman.enter(self._tab.win_id, usertypes.KeyMode.insert,
'clicking input')
else:
self._click_fake_event(click_target)
elif click_target in [usertypes.ClickTarget.tab,

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
@@ -28,6 +28,10 @@ class CertificateErrorWrapper(usertypes.AbstractCertificateErrorWrapper):
"""A wrapper over a QWebEngineCertificateError."""
def __init__(self, error):
super().__init__(error)
self.ignore = False
def __str__(self):
return self._error.errorDescription()
@@ -37,5 +41,8 @@ class CertificateErrorWrapper(usertypes.AbstractCertificateErrorWrapper):
self._error.error()),
string=str(self))
def url(self):
return self._error.url()
def is_overridable(self):
return self._error.isOverridable()

View File

@@ -0,0 +1,48 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# qutebrowser is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
"""Filter for QtWebEngine cookies."""
from qutebrowser.config import config
from qutebrowser.utils import utils
def _accept_cookie(request):
"""Check whether the given cookie should be accepted."""
accept = config.val.content.cookies.accept
if accept == 'all':
return True
elif accept in ['no-3rdparty', 'no-unknown-3rdparty']:
return not request.thirdParty
elif accept == 'never':
return False
else:
raise utils.Unreachable
def install_filter(profile):
"""Install the cookie filter on the given profile.
On Qt < 5.11, the filter isn't installed.
"""
store = profile.cookieStore()
try:
store.setCookieFilter(_accept_cookie)
except AttributeError:
pass

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
@@ -19,20 +19,22 @@
"""A request interceptor taking care of adblocking and custom headers."""
from PyQt5.QtWebEngineCore import QWebEngineUrlRequestInterceptor
from PyQt5.QtWebEngineCore import (QWebEngineUrlRequestInterceptor,
QWebEngineUrlRequestInfo)
from qutebrowser.config import config
from qutebrowser.browser import shared
from qutebrowser.utils import utils, log
from qutebrowser.utils import utils, log, debug
class RequestInterceptor(QWebEngineUrlRequestInterceptor):
"""Handle ad blocking and custom headers."""
def __init__(self, host_blocker, parent=None):
def __init__(self, host_blocker, args, parent=None):
super().__init__(parent)
self._host_blocker = host_blocker
self._args = args
def install(self, profile):
"""Install the interceptor on the given QWebEngineProfile."""
@@ -54,15 +56,29 @@ class RequestInterceptor(QWebEngineUrlRequestInterceptor):
Args:
info: QWebEngineUrlRequestInfo &info
"""
if 'log-requests' in self._args.debug_flags:
resource_type = debug.qenum_key(QWebEngineUrlRequestInfo,
info.resourceType())
navigation_type = debug.qenum_key(QWebEngineUrlRequestInfo,
info.navigationType())
log.webview.debug("{} {}, first-party {}, resource {}, "
"navigation {}".format(
bytes(info.requestMethod()).decode('ascii'),
info.requestUrl().toDisplayString(),
info.firstPartyUrl().toDisplayString(),
resource_type, navigation_type))
url = info.requestUrl()
# FIXME:qtwebengine only block ads for NavigationTypeOther?
if self._host_blocker.is_blocked(info.requestUrl()):
if self._host_blocker.is_blocked(url):
log.webview.info("Request to {} blocked by host blocker.".format(
info.requestUrl().host()))
url.host()))
info.block(True)
for header, value in shared.custom_headers():
for header, value in shared.custom_headers(url=url):
info.setHttpHeader(header, value)
user_agent = config.val.content.headers.user_agent
user_agent = config.instance.get('content.headers.user_agent', url=url)
if user_agent is not None:
info.setHttpHeader(b'User-Agent', user_agent.encode('ascii'))

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2017 Michal Siedlaczek <michal.siedlaczek@gmail.com>
# Copyright 2017-2018 Michal Siedlaczek <michal.siedlaczek@gmail.com>
# This file is part of qutebrowser.
#
@@ -21,26 +21,73 @@
import glob
import os
import os.path
import re
import shutil
from PyQt5.QtCore import QLibraryInfo
from qutebrowser.utils import log, message, standarddir, qtutils
dict_version_re = re.compile(r".+-(?P<version>[0-9]+-[0-9]+?)\.bdic")
def dictionary_dir():
def version(filename):
"""Extract the version number from the dictionary file name."""
match = dict_version_re.match(filename)
if match is None:
message.warning(
"Found a dictionary with a malformed name: {}".format(filename))
return None
return tuple(int(n) for n in match.group('version').split('-'))
def dictionary_dir(old=False):
"""Return the path (str) to the QtWebEngine's dictionaries directory."""
datapath = QLibraryInfo.location(QLibraryInfo.DataPath)
if qtutils.version_check('5.10', compiled=False) and not old:
datapath = standarddir.data()
else:
datapath = QLibraryInfo.location(QLibraryInfo.DataPath)
return os.path.join(datapath, 'qtwebengine_dictionaries')
def installed_file(code):
"""Return the installed dictionary for the given code.
def local_files(code):
"""Return all installed dictionaries for the given code.
Return the filename of the installed dictionary or None
if the dictionary is not installed.
The returned dictionaries are sorted by version, therefore the latest will
be the first element. The list will be empty if no dictionaries are found.
"""
pathname = os.path.join(dictionary_dir(), '{}*.bdic'.format(code))
matching_dicts = glob.glob(pathname)
if matching_dicts:
with_extension = os.path.basename(matching_dicts[0])
return os.path.splitext(with_extension)[0]
else:
return None
versioned_dicts = []
for matching_dict in matching_dicts:
parsed_version = version(matching_dict)
if parsed_version is not None:
filename = os.path.basename(matching_dict)
log.config.debug('Found file for dict {}: {}'
.format(code, filename))
versioned_dicts.append((parsed_version, filename))
return [filename for version, filename
in sorted(versioned_dicts, reverse=True)]
def local_filename(code):
"""Return the newest installed dictionary for the given code.
Return the filename of the installed dictionary with the highest version
number or None if the dictionary is not installed.
"""
all_installed = local_files(code)
return os.path.splitext(all_installed[0])[0] if all_installed else None
def init():
"""Initialize the dictionary path if supported."""
if qtutils.version_check('5.10', compiled=False):
new_dir = dictionary_dir()
old_dir = dictionary_dir(old=True)
os.environ['QTWEBENGINE_DICTIONARIES_PATH'] = new_dir
try:
if os.path.exists(old_dir) and not os.path.exists(new_dir):
shutil.copytree(old_dir, new_dir)
except OSError:
log.misc.exception("Failed to copy old dictionaries")

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2015-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#

View File

@@ -1,6 +1,6 @@
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
@@ -45,6 +45,10 @@ class DownloadItem(downloads.AbstractDownloadItem):
qt_item.downloadProgress.connect(self.stats.on_download_progress)
qt_item.stateChanged.connect(self._on_state_changed)
# Ensure wrapped qt_item is deleted manually when the wrapper object
# is deleted. See https://github.com/qutebrowser/qutebrowser/issues/3373
self.destroyed.connect(self._qt_item.deleteLater)
def _is_page_download(self):
"""Check if this item is a page (i.e. mhtml) download."""
return (self._qt_item.savePageFormat() !=
@@ -96,9 +100,19 @@ class DownloadItem(downloads.AbstractDownloadItem):
self._qt_item.cancel()
def retry(self):
# https://bugreports.qt.io/browse/QTBUG-56840
raise downloads.UnsupportedOperationError(
"Retrying downloads is unsupported with QtWebEngine")
state = self._qt_item.state()
if state != QWebEngineDownloadItem.DownloadInterrupted:
log.downloads.warning(
"Trying to retry download in state {}".format(
debug.qenum_key(QWebEngineDownloadItem, state)))
return
try:
self._qt_item.resume()
except AttributeError:
raise downloads.UnsupportedOperationError(
"Retrying downloads is unsupported with QtWebEngine on "
"Qt/PyQt < 5.10")
def _get_open_filename(self):
return self._filename
@@ -125,6 +139,7 @@ class DownloadItem(downloads.AbstractDownloadItem):
question = usertypes.Question()
question.title = title
question.text = msg
question.url = 'file://{}'.format(self._filename)
question.mode = usertypes.PromptMode.yesno
question.answered_yes.connect(self._after_set_filename)
question.answered_no.connect(no_action)
@@ -133,6 +148,23 @@ class DownloadItem(downloads.AbstractDownloadItem):
self.error.connect(question.abort)
message.global_bridge.ask(question, blocking=True)
def _ask_create_parent_question(self, title, msg,
force_overwrite, remember_directory):
no_action = functools.partial(self.cancel, remove_data=False)
question = usertypes.Question()
question.title = title
question.text = msg
question.url = 'file://{}'.format(os.path.dirname(self._filename))
question.mode = usertypes.PromptMode.yesno
question.answered_yes.connect(lambda:
self._after_create_parent_question(
force_overwrite, remember_directory))
question.answered_no.connect(no_action)
question.cancelled.connect(no_action)
self.cancelled.connect(question.abort)
self.error.connect(question.abort)
message.global_bridge.ask(question, blocking=True)
def _after_set_filename(self):
self._qt_item.setPath(self._filename)
self._qt_item.accept()

Some files were not shown because too many files have changed in this diff Show More