Commit Graph

16147 Commits

Author SHA1 Message Date
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