Commit Graph

9405 Commits

Author SHA1 Message Date
Florian Bruhin
5b7615886b Merge remote-tracking branch 'origin/pr/4330' 2018-10-16 12:02:22 +02:00
Florian Bruhin
cde94e7356 Merge remote-tracking branch 'origin/pr/4332' 2018-10-16 11:38:28 +02:00
Florian Bruhin
e33d582764 Merge remote-tracking branch 'origin/pr/4342' 2018-10-16 11:16:36 +02:00
Florian Bruhin
965a2e2806 Remove unneeded win_id argument for HintManager.start 2018-10-16 11:09:27 +02:00
user202729
77f3ca8727 Optimize HintLabel.update_text 2018-10-15 22:44:40 +07:00
user202729
97bc4fa6a2 Add comment for explanation 2018-10-13 15:13:26 +07:00
user202729
622ef9294c Use integer arithmetic to compute ceil log 2018-10-13 13:49:08 +07:00
Jay Kamat
87dffa5afc
Update docs and fix style 2018-10-12 21:02:52 -07:00
Jay Kamat
2403a0fd73
Cache hot config accesses in completion 2018-10-12 18:23:36 -07:00
user202729
fad9c902c9 Fix _hint_scattered 2018-10-12 22:35:15 +07:00
Florian Bruhin
9d09aa1b40 Swap noun/verb in :config-{add,remove}-{dict-list}
See https://github.com/qutebrowser/qutebrowser/pull/4324#issuecomment-428934193
2018-10-11 14:29:10 +02:00
Florian Bruhin
1c1223821c Update docs 2018-10-11 14:18:02 +02:00
Florian Bruhin
019811f2cb Merge remote-tracking branch 'origin/pr/4324' 2018-10-11 14:16:06 +02:00
Florian Bruhin
49850b61ed Don't show no_autoconfig settings for :config-add-(list|dict) 2018-10-11 14:07:57 +02:00
Florian Bruhin
3e39fc0e69 Simplify HintManager.start 2018-10-11 14:01:47 +02:00
Milo Gertjejansen
9fd57b9be0 New config: More powerful :config- commands: remove
- `:config-remove-list` command to remove items from a list.
- `:config-remove-dict` command to remove items from a dict.
- Test coverage.

Continues #2794
2018-10-10 20:23:44 -05:00
Florian Bruhin
ae6fda3699 Release v1.5.1 2018-10-10 08:24:08 +02:00
Florian Bruhin
64b308ebeb Adjust workaround comment 2018-10-10 08:03:51 +02:00
Florian Bruhin
69d2433584 Remove TextBase.setText workaround
Reverts 561a7e1cdd
https://bugreports.qt.io/browse/QTBUG-36945 apparently got fixed at some point.
2018-10-10 07:56:59 +02:00
Florian Bruhin
d46b0cf3cd Update docs 2018-10-08 20:07:56 +02:00
Florian Bruhin
3fe64085f8 Add tabindex to default 'all' selector
See #178
2018-10-08 19:43:25 +02:00
Florian Bruhin
f36285658e Don't allow to set hints.selectors in autoconfig.yml
Also, set all settings temporarily for end2end tests.
This allows us to set things which aren't settable in autoconfig.yml.
2018-10-08 19:40:33 +02:00
Florian Bruhin
0423ec6f91 Add webelem.css_selector 2018-10-08 19:40:33 +02:00
Florian Bruhin
121483aa90 Add error handling for invalid selectors 2018-10-08 19:07:53 +02:00
Florian Bruhin
6d4c8f5b13 Merge remote-tracking branch 'origin/pr/3806' into test 2018-10-08 18:09:58 +02:00
Florian Bruhin
91ae86db62 Merge remote-tracking branch 'origin/pr/3950' 2018-10-08 17:36:10 +02:00
Florian Bruhin
6168622de3 Update docs 2018-10-07 17:12:01 +02:00
Florian Bruhin
7cea4e3262 Merge remote-tracking branch 'origin/pr/4283' 2018-10-07 17:00:12 +02:00
Florian Bruhin
b130162d56 Fix crash when closing tab during a search 2018-10-07 15:46:40 +02:00
Milo Gertjejansen
bcfc8fa3a8 New config: More powerful :config- commands: add #4283
Missed a small comment change.

Continues #2794
2018-10-06 19:45:36 -05:00
Milo Gertjejansen
a3528dcee8 New config: More powerful :config- commands: add #4283
Made minor changes to the second commit which broke tests out into
success and failure tests taking advantage of pytests.raises.

Additionally updated several grammar issues.

Continues #2794
2018-10-06 19:42:30 -05:00
Jay Kamat
2f21551322
Cache config accesses in minimumTabSizeHint 2018-10-06 14:13:23 -07:00
Florian Bruhin
c689760872 Sort keys in configtypes.Dict.to_str
Otherwise, we get inconsistent output between runs on Python 3.5
2018-10-06 19:18:43 +02:00
Florian Bruhin
4b76dc56e1 Merge remote-tracking branch 'origin/pr/4296' 2018-10-06 12:24:02 +02:00
Florian Bruhin
587b11f60d Make completion highlighting case-insensitive again
Fixes #4297
2018-10-06 09:57:01 +02:00
Jay Kamat
2f155e5d2b
Fix tabs appearing when updating all tab titles
Closes #4295
2018-10-05 18:55:30 -07:00
Florian Bruhin
5fd20da915 Update docs 2018-10-06 00:13:58 +02:00
Florian Bruhin
c6dc9206e6 Handle invalid QUrl objects in HostBlocker.is_blocked
For some requests, we don't know a first party URL, so we get an invalid QUrl
object from QtWebKit/QtWebEngine.

However, the config system wants either a valid QUrl or None (for the global
value), so we don't accidentally pass an invalid QUrl in. Thus, do the
conversion here.
2018-10-06 00:13:58 +02:00
Florian Bruhin
14957c75ff Merge remote-tracking branch 'origin/pr/4046' 2018-10-05 23:36:40 +02:00
Florian Bruhin
c225e724ac Merge remote-tracking branch 'origin/pr/4133' 2018-10-05 22:56:53 +02:00
Florian Bruhin
bb35285914 Fix passing filename to GreasemonkeyScript 2018-10-05 19:25:19 +02:00
Florian Bruhin
4b13609553 Fix lint 2018-10-05 18:50:14 +02:00
Florian Bruhin
81e5173c9c Fix getting searchengines in URL model 2018-10-05 17:51:04 +02:00
Florian Bruhin
42ef645cf1 Merge remote-tracking branch 'origin/pr/4004' 2018-10-05 17:46:49 +02:00
Florian Bruhin
1e8bb202e9 Make :q only close the active window
Closes #4061
Fixes #1089
2018-10-05 17:31:00 +02:00
Florian Bruhin
2c3f144cd5 Update docs 2018-10-05 17:21:36 +02:00
Florian Bruhin
fddb10e157 Merge remote-tracking branch 'origin/pr/4008' 2018-10-05 17:15:42 +02:00
Florian Bruhin
5eb0447fec Update docs 2018-10-05 16:21:02 +02:00
Florian Bruhin
95f816c224 Merge remote-tracking branch 'origin/pr/4292' 2018-10-05 16:20:08 +02:00
Florian Bruhin
616cd0a59c Fix and test remaining PDF.js OSError issues 2018-10-05 16:06:39 +02:00
Florian Bruhin
b5b4fda676 Fix issues with PDF.js path changes 2018-10-05 14:05:54 +02:00
Milo Gertjejansen
7f0ae252cd New config: More powerful :config- commands: add #4283
Made requested changes:

- Separated list add and dict add commands.
- Separated list and dict completion models.
- Created tests for each command.
- Simplified the configmodel options by breaking them into a separate
function to do work that is similar.
- General simplification of both add commands.

Continues #2794
2018-10-04 18:42:33 -05:00
Viacheslav Chimishuk
8e2723fa77 Add yank --quiet option support. 2018-10-04 21:41:17 +03:00
Florian Bruhin
6c245ca7a0 Merge remote-tracking branch 'origin/pr/4220' 2018-10-04 19:34:03 +02:00
Florian Bruhin
8a3704fbe4 Update docs 2018-10-04 19:33:02 +02:00
Florian Bruhin
923b726e38 Merge remote-tracking branch 'origin/pr/4220' 2018-10-04 19:28:01 +02:00
Florian Bruhin
5514ddeed5 Log OSError for PDF.js more explicitly
Closes #4289
2018-10-04 16:54:44 +02:00
Florian Bruhin
659be2296f Don't log stacktraces for qute:// errors 2018-10-04 16:54:44 +02:00
Florian Bruhin
29142f763c Use a proper data dir for PDF.js 2018-10-04 16:54:44 +02:00
Florian Bruhin
0caff547aa Show/hide TabBar and not TabWidget with many tabs 2018-10-04 15:54:07 +02:00
Ryan Roden-Corrent
a5b3670477
Fix pylint/flake8 errors in configtypes. 2018-10-03 21:44:10 -04:00
Ryan Roden-Corrent
59f9d31d4b
Fix up configtypes based on code review.
- Remove stray statements
- add an early bail-out if we can't parse a color function
- add more test cases
2018-10-03 17:41:48 -04:00
Florian Bruhin
d04b435ed2 Add coverage comment 2018-10-03 16:23:59 +02:00
Florian Bruhin
7e7d18f113 Release v1.5.0 2018-10-03 15:55:48 +02:00
Florian Bruhin
9ca6da485c Handle None values in lessThan 2018-10-03 15:15:25 +02:00
Ryan Roden-Corrent
46683b82e7
Change colors.completion.match.fg to QtColor.
The color is now used in a custom Highlighter class, not set in a
stylesheet.
2018-10-02 17:47:33 -04:00
Ryan Roden-Corrent
66cc5f5ea4
Add support for more values in QtColor config type.
Recent changes in the completion highlighter mandate that
config.val.colors.completion.match be changed from a QssColor to a
QtColor. However, the latter accepts fewer formats. To avoid breaking
configs, this allows QtColors to be specified using all the same formats
as QssColors, excluding gradients.

I separated the QssColor and QtColor tests as the previous approach of
generating the tests made adding tests for QtColor more complicated.

While working on this I discovered that Qt's css parser is potentially
broken around parsing hsv percentages and filed
https://bugreports.qt.io/browse/QTBUG-70897.

For consistency, I made our parser similarly broken.

You can show the bug in qutebrowser right now by noting that the
following have different effects:

```
set colors.completion.odd.bg 'hsv(100%, 100%, 100%)'
set colors.completion.odd.bg 'hsv(358, 255, 255)'
```
2018-10-02 17:30:43 -04:00
Florian Bruhin
55ec72df00 Re-break lines 2018-10-02 13:33:41 +02:00
Milo Gertjejansen
876a2bdaa1 New config: More powerful :config- commands: add
Adds the config-add command.

Modifies #2794
2018-10-01 22:22:39 -05:00
lyeoh
1b8e1a9ea4 Fix url available to :navigate (strip query) 2018-10-01 16:24:54 -05:00
Florian Bruhin
4060fcc1c6 Fix lint 2018-10-01 21:54:08 +02:00
Florian Bruhin
8a7c1b66a4 Add :tab-{give,take} --keep 2018-10-01 16:54:02 +02:00
Florian Bruhin
8f33b89a57 Merge remote-tracking branch 'origin/pr/4276' 2018-10-01 11:21:40 +02:00
Jay Kamat
2b35d04607
Select text node in tests to imitate real selections 2018-09-30 23:29:24 -07:00
Florian Bruhin
a3ae950707 Ignore click events with invalid positions
Since Qt 5.11.2, various crash logs like this popped up after clicking a
<select> element:

    Traceback (most recent call last):
      File ".../browser/mouse.py", line 239, in eventFilter
        return self._handlers[evtype](event)
      File ".../browser/mouse.py", line 121, in _handle_mouse_press
        self._mousepress_insertmode_cb)
      File ".../browser/webengine/webenginetab.py", line 624, in find_at_pos
        assert pos.x() >= 0
    AssertionError

This is probably caused by https://codereview.qt-project.org/#/c/193908/ in
some way...
2018-09-30 22:55:17 +02:00
Florian Bruhin
c7c9a2cb84 Fix _is_pinned() during init 2018-09-30 22:14:19 +02:00
Florian Bruhin
45a3611b62 Update docs 2018-09-30 22:08:00 +02:00
Florian Bruhin
6f01571462 Rename variable 2018-09-30 22:02:11 +02:00
Florian Bruhin
4b495303f9 Merge remote-tracking branch 'origin/pr/4191' 2018-09-30 22:01:57 +02:00
Florian Bruhin
8d489a40e4 Simplify toggle_visibility 2018-09-30 21:53:19 +02:00
Florian Bruhin
b8be4e5915 Merge remote-tracking branch 'origin/pr/4266' 2018-09-30 21:52:35 +02:00
Florian Bruhin
96f28c6f72 Show errors on invalid --mode argument for :hint 2018-09-30 11:45:59 +02:00
Florian Bruhin
d362299e4e Repeat last run macro with @@ 2018-09-30 11:09:42 +02:00
Jay Kamat
322b053cbf
Merge branch 'master' of https://github.com/qutebrowser/qutebrowser into jay/visible-update-titles 2018-09-29 12:29:50 -07:00
Jay Kamat
a5f9115b2f
Only apply visibility toggle if we have >10 tabs 2018-09-29 12:26:42 -07:00
zaowen
5b089d0460 Minor requested changes 2018-09-29 02:00:42 -06:00
Florian Bruhin
2630f779cd Make tab attributes more consistent 2018-09-28 19:48:24 +02:00
Florian Bruhin
2f121d77df Update docs 2018-09-28 19:38:17 +02:00
Florian Bruhin
54c39484d3 Use signals instead of making scripts public 2018-09-28 19:38:17 +02:00
Florian Bruhin
6d0d408785 Use when-searching, not when_searching 2018-09-28 19:28:32 +02:00
Florian Bruhin
628e4e8692 Fix lint 2018-09-28 19:28:32 +02:00
Florian Bruhin
19589c93b5 Only update stylesheet if we actually had a search
We call search.clear() a lot, even before the stylesheet JS was initialized.

After we've done a search, we can be sure that it is inited, and we only need
to hide the scrollbar there.
2018-09-28 19:28:32 +02:00
Florian Bruhin
10646cf9b8 Merge remote-tracking branch 'origin/pr/4186' 2018-09-28 19:27:59 +02:00
Florian Bruhin
2b1ebe2762 Improve content.mute docs 2018-09-28 17:36:35 +02:00
Florian Bruhin
29691f302d Update mute status if content.mute was changed 2018-09-28 16:40:08 +02:00
Florian Bruhin
18ed790c88 Don't touch mute status after the user changed it 2018-09-28 16:40:08 +02:00
Florian Bruhin
6be4ee2ff3 configtypes: Be more explicit about None-values 2018-09-28 16:40:08 +02:00
Florian Bruhin
f780974d07 Allow fallback=False with config.get/get_obj 2018-09-28 16:40:08 +02:00
Florian Bruhin
5527d27ba7 Merge remote-tracking branch 'origin/pr/4189' 2018-09-28 13:02:45 +02:00
Florian Bruhin
3eed63346e Merge remote-tracking branch 'origin/pr/4261' 2018-09-28 12:34:04 +02:00
Florian Bruhin
ead82d741a Remove unneeded decorators 2018-09-28 12:23:38 +02:00
Florian Bruhin
a8e95dc866 Merge remote-tracking branch 'origin/pr/4265' 2018-09-28 12:22:17 +02:00
Viacheslav Chimishuk
003e007ace Improve functions' documentation. 2018-09-28 12:09:47 +03:00
Jay Kamat
e746325d9e
Turn off visibility of tabs while updating titles
Improves performance dramatically when all titles change at once, such
as when the first tab is removed.
2018-09-27 21:16:33 -07:00
Jay Kamat
de148bb778
Fix tabwidget tests 2018-09-27 19:59:43 -07:00
Jay Kamat
14e55eae49
Merge remote-tracking branch 'upstream/master' into jay/max-tab 2018-09-27 19:03:15 -07:00
Florian Bruhin
3d61eafb07 Merge commit 'ad02d01b2a2e2850bd8e53e3543e79579fd0e84c' 2018-09-27 23:42:03 +02:00
Florian Bruhin
8d28cee530 Merge remote-tracking branch 'origin/pr/4263' 2018-09-27 23:25:32 +02:00
Viacheslav Chimishuk
232574212d Add zoom, zoom-in and zoom-out --quiet option support. 2018-09-27 23:54:13 +03:00
Florian Bruhin
36d7dc4853 Add :prompt-open-download --pdfjs 2018-09-27 22:25:29 +02:00
Nicolas Schodet
d22679f325 Sort settings page by name 2018-09-27 22:05:54 +02:00
Florian Bruhin
bfa7d6a566 Update docs 2018-09-27 16:36:33 +02:00
Florian Bruhin
718376f154 Refactor JS escaping
This renames javascript.convert_js_arg() to javascript.to_js() and uses that
instead of string_escape() where possible.
2018-09-27 16:36:28 +02:00
Florian Bruhin
38a4734b9a Merge remote-tracking branch 'origin/pr/4204' 2018-09-27 16:28:30 +02:00
Florian Bruhin
d4176012e5 Merge remote-tracking branch 'origin/pr/4246' 2018-09-27 16:07:49 +02:00
Florian Bruhin
bb346bf6d1 Adjust dates in _chromium_version 2018-09-27 14:00:58 +02:00
Jay Kamat
e01682f51d
Add tabs.max_width setting 2018-09-26 21:39:45 -07:00
Florian Bruhin
a292664ca0 Merge remote-tracking branch 'origin/pr/4218' 2018-09-26 11:20:45 +02:00
Florian Bruhin
62ea8f6ec2 Merge remote-tracking branch 'origin/pr/4245' 2018-09-26 08:42:54 +02:00
Florian Bruhin
cb2a246070 Update Chromium version overview 2018-09-26 06:32:09 +02:00
Florian Bruhin
a8355022db Pass through Ctrl+Mousewheel in passthrough mode
See #3836
2018-09-25 20:39:42 +02:00
Florian Bruhin
3efb7e6957 Auto-remove PDF.js downloads 2018-09-24 19:45:31 +02:00
Florian Bruhin
119a60d498 caret: Don't turn on animation repeatedly 2018-09-24 19:23:11 +02:00
Florian Bruhin
3c1ab71fce Remove dead CaretBrowsing code 2018-09-24 18:29:17 +02:00
Florian Bruhin
fc89f3dfcc Always open PDF.js tabs in foreground 2018-09-24 15:44:12 +02:00
Florian Bruhin
7b20bf4792 Fix tab_focus_last behaviour with :tab-focus -1
See #4248
2018-09-24 11:06:41 +02:00
Jay Kamat
67c108a320
Get pinned status from parent 2018-09-23 23:35:40 -07:00
Jay Kamat
773fe47687
Avoid calls to minTabSizeHint in tabSizeHint 2018-09-23 23:00:44 -07:00
Ben Gartner
ad02d01b2a Change commands.py document generator 2018-09-23 16:46:01 -05:00
Florian Bruhin
1e32d1e01f Fix PDFJS/qutescheme end2end tests 2018-09-23 17:40:10 +02:00
Florian Bruhin
e9ca4c4295 Merge remote-tracking branch 'origin/pr/4234' 2018-09-22 21:14:54 +02:00
Florian Bruhin
01f69bda4b Merge remote-tracking branch 'origin/pr/4233' 2018-09-22 21:14:49 +02:00
Florian Bruhin
75bfb547ba Add compatibility with PDF.js v2.x
Closes #4237
2018-09-22 20:26:25 +02:00
Florian Bruhin
ee5d98d5d0 Make sure PDF.js doesn't try to use the Fetch API
Closes #4235
2018-09-22 20:10:57 +02:00
Florian Bruhin
22a4aaa73c Handle empty session files gracefully
There's still much more to do for #1926, but with this we at least handle one
common case gracefully.

No tests because test_sessions.py is still in a kinda bad place...
2018-09-22 19:29:36 +02:00
Ryan Roden-Corrent
0fed563a02
Use QSyntaxHighlighter for completion.
This is a more "Qt" way of highlighting syntax, and works around the
problems of #4199 without resorting to complicated html escaping.

The tests are more straightforward with less mocking, but do involve
testing a private class.
2018-09-22 12:13:28 -04:00
Jay Kamat
f0568ece57
Make convert_js_arg public and use it for dispatch_element in webkit 2018-09-21 18:08:04 -07:00
Jay Kamat
1ea45780df
Only repaint tabs when they are needed 2018-09-21 00:15:02 -07:00
Jay Kamat
84a8845905
Use qt to equally size tabs 2018-09-20 23:21:11 -07:00
Florian Bruhin
bee806b2e2 Merge remote-tracking branch 'origin/pr/4231' 2018-09-20 20:26:21 +02:00
zaowen
0680f84ca4 fix auto merge problem 2018-09-20 11:56:12 -06:00
Zarthur
b41d7ba203
Merge branch 'master' into master 2018-09-20 11:02:27 -06:00
zaowen
c4cca4755e Add adblock import directory unit test 2018-09-20 10:38:50 -06:00
Jay Kamat
1da2bdb1e5
Add bubbles, cancelable, and composed options to dispatch_event 2018-09-19 23:53:53 -07:00
Florian Bruhin
b4a0e16db9 Fix appending text
This was broken in 6e954a1596.
2018-09-19 21:56:39 +02:00
Olmo Kramer
5bf6c97a68
Add bindings to toggle content.images 2018-09-19 12:48:13 +02:00
Florian Bruhin
93ec3e3fad Make some stuff in adblock.py private 2018-09-18 20:27:58 +02:00
Florian Bruhin
1a0c6964e3 Fix lint 2018-09-18 20:25:58 +02:00
Ellis
398519762b Merge branch 'master' of https://github.com/qutebrowser/qutebrowser 2018-09-18 13:33:30 -04:00
Ellis
2dec2b0c53 Reworded docs in whitelist config setting 2018-09-18 13:21:22 -04:00
Ellis
c3d8f66673 Renamed is_whitelisted_host to is_whitelisted_url, removed unused try block 2018-09-18 13:17:02 -04:00
Florian Bruhin
46435bcd2f Use always/never instead of force-on/force-off 2018-09-18 11:12:50 +02:00
Florian Bruhin
45529c59a9 Add QtWebKit warning to backendproblem dialogs 2018-09-18 08:53:13 +02:00
Florian Bruhin
5218d35385 Also style h2 in styled.html 2018-09-18 08:53:13 +02:00
Florian Bruhin
f2e91cc82e Add warnings for QtWebKit and old Qt
See #3839, #4039
2018-09-18 08:53:11 +02:00
Florian Bruhin
d759846189 Remove old qute_backend_warning 2018-09-18 08:52:50 +02:00
Florian Bruhin
ce532654cb Clean up _open_special_pages() 2018-09-17 22:05:07 +02:00
Florian Bruhin
7858beee06 Fix lint 2018-09-17 20:33:37 +02:00
Florian Bruhin
91df81f5ab Refactor configinit.qt_args 2018-09-17 19:40:18 +02:00
Florian Bruhin
17c7663ad0 Make content.headers.referer work on QtWebEngine 2018-09-17 19:40:18 +02:00
Ellis
9c8a299a60 Removed unused variable and updated url function call 2018-09-17 13:21:54 -04:00
Ellis
80463cf8d8 Reworded configdata to fit with previously used descriptions 2018-09-17 12:49:07 -04:00
Ellis
ca0c892cbc Fixed passing UrlPattern Object into itself 2018-09-17 12:40:56 -04:00
Florian Bruhin
bd21686e0d Add webrtc_ip_handling_policy setting
This exposes all possible values, but before
https://codereview.qt-project.org/#/c/240121/ we won't be able to change those
at runtime (or enable URL patterns, which thankfully weren't enabled for the
old setting).

In theory, it'd be possible to handle the "public-interface-only" value via
QWebEngineSettings without requiring a restart, but it isn't worth the trouble.

Closes #4201
2018-09-17 18:39:41 +02:00
Florian Bruhin
6fe09c12da Add a setting for Chromium's low-end device mode
See #4039
See #2377
2018-09-17 18:39:41 +02:00
Ellis
8e42683f41 Changed QUrlPattern to UrlPattern 2018-09-17 12:27:45 -04:00
Ellis
c42a7dff0e Changed QUrl to QUrlPattern 2018-09-17 12:05:46 -04:00
Ellis
15b00cea6a Merge branch 'master' of https://github.com/qutebrowser/qutebrowser 2018-09-17 11:59:10 -04:00
Ellis
92b56b3d38 Changed configdata to use QUrl for adblock whitelisting 2018-09-17 11:57:20 -04:00
Florian Bruhin
574d7c6a11 Add settings for process models
See #4039, #2377
Fixes #4040
2018-09-17 17:22:51 +02:00
Florian Bruhin
27d0d148b8 Split up _asciidoc_fallback_path from qute_help 2018-09-17 10:29:00 +02:00
Florian Bruhin
be0d6ef3d2 Try more possible asciidoc paths for qute://help fallback 2018-09-17 09:51:15 +02:00
Ellis
1384e14bf1 Removed unused import statement 2018-09-16 20:36:00 -04:00
Ellis
3f8958054b Fixed is_whitelisted_host to use QUrl fixes #4179 2018-09-16 19:41:49 -04:00
Ellis
770a95c101 Changed is_whitelisted_host to use URL Patterns fixes #4179 2018-09-16 19:12:49 -04:00
Florian Bruhin
abff44def6 Get rid of end-of-doc-workaround in caret browsing
In Qt < 5.10 (and also sometimes on Windows), we get extra spaces or newlines
when moving to the end of the document. However, this only happens *sometimes*,
and manual testing confirms that with the current workaround, we actually lose
the last char in the selection.

I'm not sure what's happening there, but instead of making things worse with
the workaround, let's just be a bit less strict with the checking there and
accept both variants... This seems like some Chromium bug we can't do much
about.
2018-09-15 20:39:35 +02:00
Ryan Roden-Corrent
102c6b99dd
Don't highlight html escapes in completion.
Resolves #4199.

To avoid accidentally highlighting characters that were introduced by
html escaping the text before feeding it to setHtml, we can't just
escape the whole string before adding the highlighting. Instead, we need
to break the string up on the pattern, format and escape the individual
parts, then join them back together.

re.escape includes empty strings if there is a match at the start/end,
which ensures that matches always land on odd indices:

https://docs.python.org/3/library/re.html#re.split

> If there are capturing groups in the separator and it matches at the
> start of the string, the result will start with an empty string. The
> same holds for the end of the string
2018-09-15 14:06:28 -04:00
Ryan Roden-Corrent
4f99af5876
Don't escape quotes in completion text.
Resolves the example case in #4199, but not the larger problem. We don't
need to escape quotes as we don't put the string in an attribute value.
From the docs at
https://docs.python.org/3/library/html.html#html.escape:

> If the optional flag quote is true, the characters (") and (') are also
> translated; this helps for inclusion in an HTML attribute value
> delimited by quotes, as in <a href="...">.

Escaping quotes means we end up with a literal &#x27; in the completion
view wherever there is a quote in the source text.

However, problem in #4199, where unexpected parts of the text are
highlighted, can also happen with '<', '>', and '&', which still must be
escaped.
2018-09-15 13:39:49 -04:00
Florian Bruhin
59413810bf Clean up emitting of follow_selected_done 2018-09-15 15:48:40 +02:00
zaowen
bdc41db601 Adblock import handles local directories and paths
Fixes #464
* Handles local Directories
* Handles local paths without file://
2018-09-15 02:22:44 -06:00
Florian Bruhin
d74daf9294 Fix lint 2018-09-14 22:52:40 +02:00
Florian Bruhin
4ae78d9bb2 Revert "Revert "Make sure we wait until follow_selected is done""
This reverts commit 200c11625f.
2018-09-14 22:40:47 +02:00
Florian Bruhin
200c11625f Revert "Make sure we wait until follow_selected is done"
This reverts commit bc45aa33e0.
2018-09-14 21:58:42 +02:00
Florian Bruhin
bc45aa33e0 Make sure we wait until follow_selected is done 2018-09-14 20:18:33 +02:00
Jesko Dujmovic
25e396faea
Merge branch 'master' into master 2018-09-13 22:06:04 +02:00
Florian Bruhin
f9327731b8 Handle UTF-8 byte order marks in Greasemonkey scripts
See e.g. https://github.com/jerone/UserScripts/issues/135
2018-09-12 23:54:32 +02:00
Florian Bruhin
91b8002dd5 Clean up workaround for sqlite opening errors
Now that we know the real cause, we can be a bit stricter with our workaround.
2018-09-12 16:06:57 +02:00
Jay Kamat
59af280f5c
Merge pull request #4206 from airodactyl/feature/support-multiple-words-tab-give-take
Support multiple words for :tab-take without quotes
2018-09-11 18:37:21 -07:00
Florian Bruhin
c2a072f9fe Fix handling of sqlite out of memory errors
The "error_code == -1" check never passed, as error_code (confusingly) is a
string of a number.
2018-09-12 01:36:50 +02:00
Florian Bruhin
c8b447daec Clean up raise_sqlite_error 2018-09-12 01:31:41 +02:00
Florian Bruhin
941be6faed Add docstring 2018-09-11 20:45:15 +02:00
Florian Bruhin
6a480564cb Fix docs to say XDG_DATA_HOME instead of _DIR 2018-09-11 19:44:37 +02:00
Florian Bruhin
d80d9eb26c Allow downloading from PDF.js
When we click the download button in PDF.js, it downloads a blob://qute:...
URL. We can detect that and force a download rather than opening it in PDF.js
again.

Note that what actually happens depends on the Qt version and backend:

QtWebKit (any Qt version):
Downloads always work properly (regardless of Qt version).

QtWebEngine, Qt 5.7.1:
Downloads work.

QtWebEngine, Qt 5.9 - 5.11:
Downloads won't work as we need to tell PDF.js to not use blob: URLs:
https://bugreports.qt.io/browse/QTBUG-70420 - in theory, PDF.js could fall back
to downloading the existing qute:// URL, but it has a whitelist of schemes
which does not include qute://... Since it's not in that whitelist, it just
ends up doing nothing at all.

QtWebEngine, Qt 5.12:
Downloads should hopefully work properly again, as we can register the qute://
scheme with Chromium, which allows us to use blob:// URLs.
2018-09-10 13:15:39 +02:00
Florian Bruhin
02641b86fc Don't tell PDF.js to disable createObjectURL on Qt 5.7.1
Looks like things actually work fine there...
2018-09-10 13:01:01 +02:00
Michael Hoang
1b618b2501 Set maxsplit to 0 on :tab-take 2018-09-10 10:03:58 +10:00
Thomas Fischer
6b358fe955 (QtWebEngine) Unhide scrollbar on search result 2018-09-09 16:20:00 -07:00
Florian Bruhin
b4077a8543 Fix lint 2018-09-09 18:39:22 +02:00
Florian Bruhin
b96898db37 Simplify and lock down PDF.js filename handling 2018-09-09 18:35:09 +02:00
Florian Bruhin
231c1fbe59 Add underscore to temporary download filename suffix 2018-09-09 18:35:09 +02:00
Florian Bruhin
f7169dc0ba Enable content.pdfjs setting on QtWebEngine 2018-09-09 18:35:09 +02:00
Florian Bruhin
36ad2c45b5 Clean up PDF.js snippet 2018-09-09 18:35:09 +02:00
Florian Bruhin
24babe76a1 Remove dead code
Thanks vulture!
2018-09-09 18:35:09 +02:00
Florian Bruhin
490fe5e1a3 Add utils.guess_mimetype 2018-09-09 18:35:09 +02:00
Florian Bruhin
24148c649e Fix lint and tests 2018-09-09 18:35:09 +02:00
Florian Bruhin
2dccde8f4b Only set PDFJS.disableCreateObjectURL when necessary
See #4198
2018-09-09 18:35:09 +02:00
Florian Bruhin
6665a1348e Use jinja to get PDF.js script 2018-09-09 18:35:09 +02:00
Florian Bruhin
3ad7ae2a2c Remove fix_urls which isn't needed anymore
With qute://pdfjs/web/viewer.html we can use relative URLs
2018-09-09 18:35:09 +02:00
Florian Bruhin
c40ddf37b7 Set disableCreateObjectURL for PDF.js
We can't use blob URLs or we'll get a renderer crash:
https://bugreports.qt.io/browse/QTBUG-70420

Thankfully, we can tell PDF.js to use data: URLs instead.
2018-09-09 18:35:09 +02:00
Florian Bruhin
bbcb87e434 Get PDF.js to work
We need to use the /web/viewer.html path so relative references are correct.
2018-09-09 18:35:09 +02:00
Florian Bruhin
7206dde19c Revert "Simplify getting pdfjs main page"
This reverts commit 9c731bde85627308fdde4730b0181a014096cb47.

We need to set some PDF.js options, so we can't just use the default viewer
with ?file=...
2018-09-09 18:35:09 +02:00
Florian Bruhin
a0b4f09f02 Initial PDF.js support for QtWebEngine 2018-09-09 18:35:09 +02:00
Florian Bruhin
cb0c313404 Add qute://pdfjs/file to get files
Cross-origin requests aren't supported for qute:// URLs, and qute:// can't
access file://, so we need to get the files that way.
2018-09-09 18:35:09 +02:00
Florian Bruhin
8f19820a7a Remove pdfjs.fix_urls
Now that we use qute://pdfjs to show the viewer, we don't need to rewrite any
URLs.
2018-09-09 18:35:09 +02:00
Florian Bruhin
24fb3b0d1b Simplify getting pdfjs main page 2018-09-09 18:35:09 +02:00
Florian Bruhin
df67c254f8 Initial attempt at getting PDF.js to work with separate downloads 2018-09-09 18:35:09 +02:00
Florian Bruhin
8f1690eff7 Move pdfjs error page to pdfjs.py 2018-09-09 18:35:09 +02:00
Florian Bruhin
36b2f5e63f Remove qute:// backend= argument 2018-09-09 18:35:09 +02:00
Florian Bruhin
dc82ac3eb2 Move qute_pdfjs to qutescheme.py 2018-09-09 18:35:09 +02:00
Florian Bruhin
b611ff52cf Support URL patterns for content.autoplay 2018-09-09 18:31:41 +02:00
Jesko
f22fb30ef3 fixing non controversial changes 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
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
Jay Kamat
e295e8054c
Add support for triggering change handlers when using :open-editor 2018-09-08 20:39:38 -07:00
Florian Bruhin
88cbc9bb12 caret: Also enable end-of-doc-workaround on Windows 2018-09-08 16:32:28 +02:00
Florian Bruhin
3738a8c8a9 Apply caret mode workarounds correctly 2018-09-08 16:20:58 +02:00
Florian Bruhin
1647c28632 Allow lists for javascript.convert_js_arg 2018-09-08 16:20:38 +02:00
Florian Bruhin
45eece372f Don't access caretElement if it's gone 2018-09-08 15:51:42 +02:00
Florian Bruhin
03dea493de Make sure we only update the caret selection once
Otherwise, stuff goes haywire when trying to use the caret mode very fast (like
in a unit test), because new stuff runs before we've managed to update the selection.
2018-09-08 13:18:09 +02:00
cauimsouza
4a8d8688cb Improve configuration description 2018-09-07 21:46:03 +02: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
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
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
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
cauimsouza
a742f03bca Change setting name 2018-09-05 02:59:03 +02:00
cauimsouza
fc1d192880 Pass url as second argument to slot 2018-09-05 02:37:23 +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