Commit Graph

9241 Commits

Author SHA1 Message Date
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
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
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
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
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
8c0bca90d3 Merge remote-tracking branch 'origin/pr/3456' 2018-03-06 09:32:39 +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
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
2b84ea9dbe Make sure we have plain keys/modifiers where needed 2018-03-05 23:01:24 +01:00
Florian Bruhin
78f6ad14c2 Use Qt.KeyboardModifierMask 2018-03-05 22:33:16 +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
9be26a8bfd Merge remote-tracking branch 'origin/pr/3666' 2018-03-05 18:38:37 +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
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
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
3275681afd Show key when the key string is empty 2018-03-05 12:45:13 +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
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
155a1901c0 Merge branch 'keys' 2018-03-04 22:50:41 +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
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
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
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
50d2ef3b90 Fix handling of printable control keys in KeyInfo.text() 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
0aa17bfa33 Simplify unicodedata.category calls 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
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
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
c3485821c7 Adjust copyright 2018-03-04 20:20:30 +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
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
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
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
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
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
e6aa6b8235 Add missing docs for {url:host} 2018-02-27 17:29:36 +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
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
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
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
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
911b2daebf Fix test_keyutils 2018-02-27 09:07:20 +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
f40f4082ba Validate configtypes.Key correctly 2018-02-27 07:56:34 +01:00
Florian Bruhin
e8d5fb5cca Normalize keybinding with :bind 2018-02-27 07:51:14 +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
1b0aea5e05 Bring simple bindings to front in get_reverse_bindings_for 2018-02-27 06:56:57 +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
f1b20f6dc4 Fix forward_unbound_keys test 2018-02-26 20:02:43 +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
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
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
54713f57e5 Merge remote-tracking branch 'origin/pr/3624' 2018-02-25 21:09:56 +01:00
Florian Bruhin
52b5492c6a Merge branch 'per-url' 2018-02-25 19:44:51 +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
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
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
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
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
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
0d4e20c395 Whitelist config options which support URL patterns 2018-02-20 23:26:22 +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
439d51875f Add config.pattern() 2018-02-20 20:54:26 +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
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
Florian Bruhin
f2bba2e4fa Fix navigation handling 2018-02-20 12:30:41 +01:00
Florian Bruhin
d511c5436d Remove dead config code 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
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
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
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
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
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
f43c7fa360 Fix changing values in configutils.Values 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
eda15c53ad urlmatch: Improve port error output 2018-02-19 22:07:53 +01:00
bttner
e169e2165d Refactor TabbedBrowser from inheritance to composition 2018-02-19 14:29:05 +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
Marc Jauvin
872cff2ae1 make sure tab is not None either, had a crash because of this 2018-02-16 14:03:11 -05:00
Florian Bruhin
174dd5dd9e urlmatch: Remove performance FIXME 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
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
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
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
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
9092c3a87f urlmatch: Increase debuggability 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
715cc7b7dd
Make statusbar widgets configurable 2018-02-10 13:15:11 +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
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
47ec052194 Merge remote-tracking branch 'origin/pr/3558' 2018-02-09 22:50:00 +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
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
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
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
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
3e38aab0f6 Document configdata.Migrations 2018-02-09 11:31:25 +01:00
Florian Bruhin
1a81f7231b Make sure multiple wrong keys are reported 2018-02-08 22:02:22 +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
George Edward Bulmer
950e4227e3 Pylint fix 2018-02-08 14:01:51 +00: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
01ccbc679d Fix lint 2018-02-07 22:26:32 +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
aa3970c83e Merge branch 'pr/3371' 2018-02-07 18:26:19 +01:00
Florian Bruhin
054b92bbe8 Support retrying downloads with Qt 5.10
Fixes #2787
2018-02-07 11:19:41 +01:00
Florian Bruhin
5fd3943ebc Make callback mandatory for tab.selection() 2018-02-06 23:33:37 +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
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
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
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
eab9b70f28 Fix pylint for editor.py.
Notate unused parameter.
2018-02-01 20:43:35 -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
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
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
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
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
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
40df5baa83 Merge remote-tracking branch 'origin/pr/3515' 2018-01-25 09:04:44 +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
961eebaf71 Merge remote-tracking branch 'origin/pr/3510' 2018-01-24 21:33:04 +01:00
Florian Bruhin
582236e42b Merge remote-tracking branch 'origin/pr/3509' 2018-01-24 21:28:58 +01:00
Florian Bruhin
e5b6ccd716 Merge remote-tracking branch 'origin/pr/3506' 2018-01-24 21:14:25 +01:00
Florian Bruhin
caca3614f8 Merge remote-tracking branch 'origin/pr/3443' 2018-01-24 20:36:15 +01:00
Marc Jauvin
2e912eeadf move backend dependent code to AbstractAction respective classes 2018-01-23 23:30:22 -05: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
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
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 4e8abaa2d16103f42cb26919e50d59937a88ae8f)
2018-01-20 19:21:40 +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
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
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
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
b3ebcfd394 Merge remote-tracking branch 'origin/pr/3482' 2018-01-17 15:53:47 +01:00
Florian Bruhin
923785c781 Merge remote-tracking branch 'origin/pr/3467' 2018-01-17 14:41:45 +01:00
Florian Bruhin
a1798b3843 Merge remote-tracking branch 'origin/pr/3474' 2018-01-17 13:38:22 +01:00
Florian Bruhin
4acb63ca49 Merge remote-tracking branch 'origin/pr/3478' 2018-01-17 13:23:31 +01:00
Marc Jauvin
e25a33790f remove blank line to satisfy flake8 2018-01-15 20:44:56 -05:00
Marc Jauvin
fb0a418d0a use url even if we do not need it 2018-01-15 16:03:22 -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
Florian Bruhin
fbbb9ae940 Release v1.1.0 2018-01-15 19:39:16 +01: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
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
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
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
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
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
Simon Doppler
dea0aa9f7c
Add tabs page 2018-01-08 18:01:42 +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
Jay Kamat
8500509532
Implement is_visible for same-origin frames 2018-01-06 11:13:54 -08: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
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
Jay Kamat
3d508be9ff
Clear unpinned tabs before prompting user with :tab-only 2018-01-04 18:34:40 -08: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
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
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
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
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
Artur Shaikhullin
7d181ee4b5 Check if document body exists 2017-12-28 23:04:04 +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
a01566ed15 Fix loosed variable 2017-12-28 19:17:25 +06: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
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
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
seebye
801b6b90ce pylint adjustments 2017-12-20 01:15:12 +01:00
seebye
c8ae405bfe fix #3396 2017-12-20 00:10:21 +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
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
430126dcc8 pylint: Re-enable ungrouped-imports 2017-12-15 23:08:53 +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
e65c0dd8a7 pylint: Re-enable bad-continuation
And lots and lots of whitespace changes.
2017-12-15 19: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
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
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
3f9ded3bed Add missing docstrings 2017-12-15 13:55:06 +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
43588b2818 Merge remote-tracking branch 'origin/pr/3393' 2017-12-14 09:02:31 +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
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
922b1e8f10 Use system locale to decode subprocess output 2017-12-13 20:09:56 +01:00
Florian Bruhin
2b3250144b Merge remote-tracking branch 'origin/pr/3388' 2017-12-13 20:06:00 +01:00
Florian Bruhin
f32b4d88ba Merge remote-tracking branch 'origin/pr/3385' 2017-12-13 19:56:53 +01: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
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
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
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
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
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
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
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
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
6a7d2f4275 Remove dead code
QUrl.path() never returns None
2017-12-11 09:14:26 +01:00
Florian Bruhin
444f0a36df Update docs 2017-12-11 07:12:45 +01:00
Florian Bruhin
6c7b8ce895 Merge remote-tracking branch 'origin/pr/3370' 2017-12-11 07:09:49 +01: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
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
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
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
unknown
30b25da273 Added protocol key to field 2017-12-06 13:09:44 -07: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
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
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
Artur Shaikhullin
ed1d036077 Fix eslint warnings
used some eslint ignore comments
2017-12-06 12:11:06 +06:00
Florian Bruhin
0df1d07558 Merge remote-tracking branch 'origin/pr/3367' 2017-12-06 06:57:59 +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
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
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
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
Florian Bruhin
ce46b30a1e Show error instead of warning 2017-12-02 14:49:06 +01:00
Florian Bruhin
003ec31848 Merge remote-tracking branch 'origin/pr/3333' 2017-12-02 14:47:24 +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
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
Artur Shaikhullin
c7a5dd6abb Clean up javascript caret code 2017-11-30 18:02:50 +06:00
mhm@mhm.com
d29cf1ee4d lazy sessions, restore if visible, forward user after restore 2017-11-30 00:09:28 +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
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
911616707e Merge remote-tracking branch 'origin/pr/3329' 2017-11-29 10:40:40 +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
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
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
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
Jimmy
0381d74e9a Greasemonkey: privatise some utility functions 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
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
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
248a12a8b9 Add flake8-comprehensions 2017-11-26 21:42:50 +01:00
Florian Bruhin
b5dd647678 Upgrade pydocstyle/flake8-docstrings
See #3320
2017-11-26 20:30:32 +01:00
Florian Bruhin
0f3cff60fa Merge remote-tracking branch 'origin/pr/3335' 2017-11-26 19:42:54 +01:00
Florian Bruhin
38f8cacd2b Merge remote-tracking branch 'origin/pr/3336' 2017-11-26 19:35:26 +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
e05dabefdf Show default keybinding in :bind completion 2017-11-26 13:34:18 +02: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
mhm@mhm.com
9df149fe8f urlencode fix 2017-11-24 17:15:26 +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
487951cd31 Fix joining :jseval path 2017-11-22 10:57:48 +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
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
Artur Shaikhullin
8aca37e5d5 Implement all caret browsing methods 2017-11-21 19:56:00 +06: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
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
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
Artur Shaikhullin
82b1bd10ec Add some movement caret actions 2017-11-20 17:49:42 +06: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
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
akhilkpdasan
9a58fe229c
fixed spelling error 2017-11-19 19:32:24 +05:30
akhilkpdasan
ba6d90aa7a
fixed docmentation for pyeval 2017-11-19 19:08:52 +05:30
Florian Bruhin
91c909cb80 Merge remote-tracking branch 'origin/pr/3212' 2017-11-19 14:24:40 +01:00
Florian Bruhin
8c7bf12b88 Merge remote-tracking branch 'origin/pr/3306' 2017-11-19 14:08:58 +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
Akhil kp
c5eab53a87 Added --file for :debug-pyeval 2017-11-19 18:20:58 +05:30
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
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
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
Artur Shaikhullin
b184d2f94d dirty initial port of chrome caretbrowser extension 2017-11-16 19:25:15 +06:00
Florian Bruhin
b26f2290bc Merge remote-tracking branch 'origin/pr/3097' 2017-11-16 11:14:59 +01:00
Florian Bruhin
b3085f5d60 Merge remote-tracking branch 'origin/pr/3291' 2017-11-16 10:17:02 +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
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
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
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
1203be2a44 Remove unnecessary str() call 2017-11-14 06:19:42 +01: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
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
Florian Bruhin
408ceefad1 Merge branch 'none-position' 2017-11-13 20:42:22 +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
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
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
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