Commit Graph

16439 Commits

Author SHA1 Message Date
Jimmy
7a73c0f264 Add tests for greasemonkey worldid in webenginetab.
Adds a new file for tests relating to WebEngineTab, it looks a little
sparse right now but I'm sure there will be more soon.

Tests that scripts with invalid world IDs are rejected appropriately and
the ones with valid world IDs aren't rejected.

The `FakeWidget` thing is so `sip.isdeleted` didn't complain about being
passed the wrong type.
2018-09-09 20:51:19 +12:00
Jimmy
5252541fe3 greasemonkey: better handle scripts without metadata
Previously calling `script.code()` would fail if the script didn't have
a `name`. This wasn't being hit in practice because the only place that
constructs GreasemonkeyScripts was checking for that condition and add
the filename there as a fallback.

This change make the `name` attribute more explicitly mandatory by
failing with a `ValueError` if it is not provided and make it still
possible to use the filename fallback in that case by adding a
`filename` keyward argument to `__init__()`.

Additionally where `script_meta` is used in `script.code()` a fallback
to and emptry string was added so it doesn't fail for raw javascript
files without greasemonkey metadata.
2018-09-09 20:51:19 +12:00
Jimmy
32268ae66a Split _inject_greasemonkey_scripts to separate requirements.
Because flake8 was complaining about cyclomatic complexity.
2018-09-09 20:45:21 +12:00
Jesko
abea603119 moving MAX_WORLD_ID to qtutils, changing test names, fixing linter errors, changing error type to WebTabError 2018-09-09 20:45:21 +12:00
Jesko
8ef3d90b1a removing unwanted space 2018-09-09 20:45:21 +12:00
Jesko
ee9b1f4950 adding tests and improving error messages 2018-09-09 20:45:21 +12:00
Jesko
0c38cbcbdd putting in current borders 2018-09-09 20:45:21 +12:00
Jesko
8aa682e769 catching greasemonkey errors aswell 2018-09-09 20:45:21 +12:00
Jesko
583c7e4198 catch the exception 2018-09-09 20:45:21 +12:00
Florian Bruhin
93eb05598e Fix request logging 2018-09-07 16:12:40 +02:00
Florian Bruhin
0b27779c9d Allow null initiator for qute:// URLs on Qt 5.11
Before Qt 5.11.2, for unique origins, we always got QUrl() and thus passed it
through.

With Qt 5.11.2, only missing origins (browser-initiated requests) get an empty
initiator, while unique origins get QUrl("null"):
https://codereview.qt-project.org/#/c/234849/
https://bugreports.qt.io/browse/QTBUG-69372

In theory, those should be locked down (as an unique origin is e.g. a sandboxed
iframe) and never have access to any other content.

However, thanks to a Qt bug, XHR on qute:// pages has QUrl("null") as origin as
long as the URL scheme is not registered. We can only do the registering once
Qt 5.12 is out.

Since unique origins were effectively already allowed on Qt 5.11.0/.1, we pass
them through here as well until Qt 5.12.

See #4198
2018-09-07 12:25:07 +02:00
Florian Bruhin
15c547b3f5 Move QuteSchemeHandler._check_initiator to its own method 2018-09-07 12:24:54 +02:00
Florian Bruhin
5ca911bcdb Fix lint 2018-09-06 20:09:57 +02:00
Florian Bruhin
4ca8fc0cb7 Use a shared web_history fixture 2018-09-06 20:08:32 +02:00
Florian Bruhin
ab6c8dde9a Decrease minimum QProgressDialog duration
We already have a threshold before we use a QProgressDialog at all, so let's
show it quite quickly and not after 4 seconds.
2018-09-06 17:26:28 +02:00
Florian Bruhin
935d93d10e Add tests for HistoryProgress 2018-09-06 17:26:28 +02:00
Florian Bruhin
9a6c8fe1b9 Update changelog 2018-09-06 17:26:28 +02:00
Florian Bruhin
d4f16f88b6 Remove support for importing pre-v1.0.0 history 2018-09-06 17:26:28 +02:00
Florian Bruhin
ec774379bd Add tests for history progress 2018-09-06 17:13:46 +02:00
Florian Bruhin
e4b7786bcc Factor out GUI stuff to a HistoryProgress object 2018-09-06 17:04:26 +02:00
Florian Bruhin
2109b2276e Initial progress dialog for history rebuild 2018-09-06 16:52:14 +02:00
Florian Bruhin
c8be2d4f7e Fix pylint issues with config cache 2018-09-06 16:43:10 +02:00
Florian Bruhin
9a9aefeabf Update changelog 2018-09-06 16:18:26 +02:00
Florian Bruhin
cd8fd8ab3c Use config cache for completion.web_history.exclude
On my machine, this speeds up regenerating from ~6min to ~25s.
2018-09-06 16:17:23 +02:00
Florian Bruhin
108cc65bc6 Merge remote-tracking branch 'origin/pr/4185' 2018-09-06 16:15:16 +02:00
Jay Kamat
8e82adc306
Refactor configcache to cache
Also fix and improve configcache tests
2018-09-05 22:26:12 -07:00
Florian Bruhin
67f1d8abdd Revert "Add exam comments to contributing docs"
This reverts commit ae32b79d54.
2018-09-05 20:39:41 +02:00
Florian Bruhin
e2b14caa5c Update changelog 2018-09-05 14:48:31 +02:00
Florian Bruhin
4d959b28b4 Merge remote-tracking branch 'origin/pr/4107' 2018-09-05 14:47:15 +02:00
Florian Bruhin
6293bc5178 Fix lint and test 2018-09-04 23:46:34 +02:00
SubbulakshmiRS
5b8e0d8d80 Fixing the previous patches
Patch files for correct usage of QuteSchemeError and general clean up.

Closes https://github.com/qutebrowser/qutebrowser/issues/4059
2018-09-04 23:15:05 +02:00
Florian Bruhin
58793d95d7 Further clean up error handling 2018-09-04 23:05:59 +02:00
Florian Bruhin
92fcc523c5 WIP: Properly signal scheme errors 2018-09-04 23:03:10 +02:00
Florian Bruhin
2fcdc5a0c9 Merge branch 'blacklist-history' 2018-09-04 22:19:52 +02:00
Florian Bruhin
f6d0ed78d0 Improve description for completion.web_history.exclude 2018-09-04 22:19:22 +02:00
Florian Bruhin
25c189d8d4
Merge pull request #4187 from qutebrowser/pyup-scheduled-update-2018-09-03
Scheduled weekly dependency update for week 35
2018-09-03 22:29:39 +02:00
Florian Bruhin
a565fc62e4 Rebuild all requirements files 2018-09-03 20:06:18 +02:00
Florian Bruhin
e9370aeed4 Filter pytest 3.7.3/3.7.4 2018-09-03 19:55:01 +02:00
pyup-bot
6a323c9fda Update pytest-repeat from 0.6.0 to 0.7.0 2018-09-03 19:42:41 +02:00
pyup-bot
c896444289 Update pytest-qt from 3.0.0 to 3.0.2 2018-09-03 19:42:40 +02:00
pyup-bot
c8e143cdb8 Update pytest from 3.6.4 to 3.7.4 2018-09-03 19:42:38 +02:00
pyup-bot
fc29f027c7 Update py from 1.5.4 to 1.6.0 2018-09-03 19:42:37 +02:00
pyup-bot
9e93009d54 Update py from 1.5.4 to 1.6.0 2018-09-03 19:42:35 +02:00
pyup-bot
c9f049a886 Update hypothesis from 3.69.0 to 3.70.3 2018-09-03 19:42:34 +02:00
pyup-bot
3026f14729 Update cheroot from 6.4.0 to 6.5.2 2018-09-03 19:42:32 +02:00
pyup-bot
998a55844a Update atomicwrites from 1.1.5 to 1.2.0 2018-09-03 19:42:31 +02:00
pyup-bot
bc1296f55e Update github3.py from 1.1.0 to 1.2.0 2018-09-03 19:42:29 +02:00
pyup-bot
9205f68f9c Update github3.py from 1.1.0 to 1.2.0 2018-09-03 19:42:28 +02:00
pyup-bot
202bac485a Update macholib from 1.10 to 1.11 2018-09-03 19:42:26 +02:00
pyup-bot
f27f2f2ae1 Update setuptools from 40.1.0 to 40.2.0 2018-09-03 19:42:25 +02:00