Commit Graph

5820 Commits

Author SHA1 Message Date
knaggita
9ff3f6810a Remove --qt-* arguments 2016-09-09 17:55:16 +02:00
Florian Bruhin
f75f45addc Fix at_bottom scrolling check
This is a regression introduced in
b45f940e72
2016-09-09 16:03:51 +02:00
Florian Bruhin
d0cf452ec8 Remove :prompt-yes and :prompt-no
Those are replaced by :prompt-accept yes and :prompt-accept no
2016-09-09 15:59:00 +02:00
Florian Bruhin
d579697245 Add a value argument to :prompt-accept 2016-09-09 15:48:42 +02:00
Florian Bruhin
b45f940e72 Move some scroll logic from JS to Python 2016-09-09 14:19:21 +02:00
Florian Bruhin
71a89bd418 *Really* fix completion with multiple words.
Turns out re.escape also escapes spaces, so we'd need to replace '(\\ )'
groups after escaping. At this point it's easier to just combine spaces
before escaping the pattern.

Fixes #1934.
Supersedes #1935.
2016-09-09 09:03:18 +02:00
Florian Bruhin
0a3853fcb7 Fix handling of spaces in completion
This is a regression introduced in
faa052ad6f.

Fixes #1934.
2016-09-08 21:59:18 +02:00
Florian Bruhin
f8f74400c6 Fix more lint 2016-09-07 18:57:00 +02:00
Florian Bruhin
955910a0e8 Fix lint 2016-09-07 18:45:46 +02:00
Florian Bruhin
44d1056e54 QtWebEngine: Implement custom HTTP headers 2016-09-07 18:29:38 +02:00
Florian Bruhin
5a54699863 Remove unused code from qutebrowser.browser.shared 2016-09-07 18:17:56 +02:00
Florian Bruhin
df7f74c782 Add qutebrowser.browser.shared 2016-09-07 18:17:05 +02:00
Florian Bruhin
d7f9e4735e earlyinit: Only display exception if there was one 2016-09-07 17:33:22 +02:00
Florian Bruhin
4d91ccfea5 Enforce Qt >= 5.6.0 for QtWebEngine 2016-09-07 17:31:48 +02:00
Florian Bruhin
02bd42cbed Implement adblocking for QtWebEngine 2016-09-07 17:27:21 +02:00
Florian Bruhin
6fec236757 Add some blank lines to app._init_modules 2016-09-07 16:45:46 +02:00
Florian Bruhin
3a55dbf712 Don't use 'current' win_id for adblock update 2016-09-07 16:24:51 +02:00
Florian Bruhin
bac7a6eaf2 Remove BrowserPage.chooseFile
Seems like QtWebKit comes with a default implementation of that.
2016-09-07 13:39:19 +02:00
Florian Bruhin
8c3906b784 Remove BrowserPage.shouldInterruptJavaScript
This is useless due to a Qt bug anyways:
https://bugreports.qt.io/issues/?jql=text%20~%20%22shouldInterruptJavascript%22
2016-09-07 12:49:57 +02:00
Florian Bruhin
fca37abf55 QtWebEngine: Implement webelem.classes 2016-09-07 12:31:48 +02:00
Florian Bruhin
3e1583bb1c Make WebKitElement._is_visible private
It makes a lot of sense for this to be in webkitelem.py, but it should
not be public API as it's only used internally and can't be implemented
here with QtWebEngine.
2016-09-07 11:58:39 +02:00
Florian Bruhin
ae3b7c9f15 Remove unused imports 2016-09-07 11:51:57 +02:00
Florian Bruhin
0ff98f568c Add a webelem logger 2016-09-07 11:51:23 +02:00
Florian Bruhin
c3b80c6b5b Use double quotes for JS strings
eslint won't enforce it inside that snippet, but hey, why not?
2016-09-07 11:48:34 +02:00
Florian Bruhin
60c86a08c4 Get rid of WebElement.debug_text 2016-09-07 11:47:39 +02:00
Florian Bruhin
e700d11447 Add check_vanished() in webkitelem.insert_text 2016-09-07 11:29:26 +02:00
Florian Bruhin
8f9cfcf232 Get rid of webelem.run_js_async 2016-09-07 11:27:37 +02:00
Florian Bruhin
78d64f4791 Get rid of webkitelem.focus_elem 2016-09-07 11:24:28 +02:00
Florian Bruhin
948fa033c7 Implement :insert-text for QtWebEngine 2016-09-07 11:20:32 +02:00
Florian Bruhin
ee5a972069 Move auto-insert-mode handling to browsertab
This means auto-insert-mode now works correctly with QtWebEngine.
2016-09-07 10:24:27 +02:00
Florian Bruhin
2ef6423cf2 Add some QtWebEngine comments to webkit.webview 2016-09-07 10:11:01 +02:00
Florian Bruhin
02df91e369 Mark colors -> webpage.bg as QtWebKit-only 2016-09-07 09:49:37 +02:00
Florian Bruhin
919196714b QtWebEngine: Implement WebEngineScroller.at_bottom 2016-09-07 09:32:51 +02:00
Daniel Schadt
22ac19b151 style fixes 2016-09-06 20:33:48 +02:00
Florian Bruhin
b65440e7e3 Update docs 2016-09-06 18:21:12 +02:00
Florian Bruhin
7c4548ece1 Split off _yank_url from :yank 2016-09-06 18:19:40 +02:00
nanjekyejoannah
d3e19ec8fc Add general -> yank-ignored-url-parameters 2016-09-06 18:19:40 +02:00
Daniel Schadt
1c76f121a2 userscripts: fix FIFO on Windows
The userscript FIFO on Windows suffered the same problem that open-editor
once did, because files on Windows can't be opened with write access by
two different processes. We kept the oshandle around and only closed it
when the process exited, which means that userscripts could not actually
write any commands to the FIFO.

This patch closes the file earlier, allowing the userscript to actually
write commands to it.

See also
https://lists.schokokeks.org/pipermail/qutebrowser/2016-September/000256.html
2016-09-06 18:03:53 +02:00
Florian Bruhin
80ac0c1b1b Remove createWindow error message
See https://github.com/The-Compiler/qutebrowser/issues/1911#issuecomment-244966547
2016-09-06 17:57:24 +02:00
Florian Bruhin
76176814e0 Move createWindow debug logging to the top 2016-09-06 17:56:25 +02:00
Florian Bruhin
921d5794a7 Add missing file 2016-09-06 17:17:12 +02:00
Florian Bruhin
7f013b7808 Fix lint 2016-09-06 17:00:25 +02:00
Florian Bruhin
c07ff15b9b bdd: Display milliseconds in log output 2016-09-06 17:00:25 +02:00
Florian Bruhin
abdc604ead :tab-clone - restore tab zoom after history
This makes cloning the zoom work with QtWebEngine.
2016-09-06 15:15:59 +02:00
Florian Bruhin
85b3d08c66 bdd: Fix scrolling tests with QtWebEngine
Scrolling happens async with QtWebEngine, so we add a new log output
when the page was scrolled, and wait for that in various places.
2016-09-06 14:58:33 +02:00
Florian Bruhin
1ed637a906 QtWebEngine: Initial session implementation 2016-09-06 13:55:35 +02:00
Florian Bruhin
3b16e171cb Avoid calling str() on bytes in mainwindow.py 2016-09-06 12:35:52 +02:00
Florian Bruhin
f6ba859896 Move tabhistory.TabHistoryItem to misc.sessions
This makes browser.webkit.tabhistory contain only QtWebKit-specific
code.
2016-09-06 09:50:55 +02:00
Florian Bruhin
2658b7c4e7 pastebin: Accept HTTPS URLs
This will let us switch the URLs the pastebin returns to HTTPS some
day...
2016-09-05 22:06:26 +02:00
Florian Bruhin
3b8537ff26 Make webkitelem/mhtml imports optional in commands 2016-09-05 18:20:48 +02:00
Florian Bruhin
bf3cccfe56 Make QWebPage import in commands.py optional 2016-09-05 18:15:30 +02:00
Florian Bruhin
1773c1cbd6 Remove wrong @pyqtSlot in downloads.py 2016-09-05 18:14:50 +02:00
Florian Bruhin
5f58ebebbf Remove needs_js for @cmdutils.register
This gets rid of a QtWebKit import in commands.py, and also makes those
checks work later when we have per-domain settings.
2016-09-05 18:11:01 +02:00
Florian Bruhin
af40abd3b2 Add websettings.shutdown() 2016-09-05 17:58:56 +02:00
Florian Bruhin
0ad8578aa8 Make QtWebKit optional in earlyinit.py 2016-09-05 17:58:29 +02:00
Florian Bruhin
308f38ab34 Rename javascript-can-open-windows setting
Fixes #1896.
2016-09-05 17:09:14 +02:00
Florian Bruhin
61270b8f92 Fix lint 2016-09-05 16:21:30 +02:00
Florian Bruhin
f2c4cedf61 QtWebEngine: Don't add invalid URLs to history 2016-09-05 15:08:00 +02:00
Florian Bruhin
cf070d48f2 WebEngine: Disable createWindow for Qt < 5.7.1
Fixes #1911.

The bugfix is backported in my qt5-webengine-debug package, and
QUTE_QTBUG54419_PATCHED can be set to force qutebrowser to use
createWindow.
2016-09-05 15:08:00 +02:00
Florian Bruhin
6a26907ded Fix lint 2016-09-05 15:08:00 +02:00
Florian Bruhin
8b7d21876f Add debug logging to createWindow 2016-09-05 15:08:00 +02:00
Florian Bruhin
2687b59373 Code cleanup 2016-09-05 15:08:00 +02:00
Florian Bruhin
a4cd0291a6 Implement QWebEngineView.createWindow 2016-09-05 15:08:00 +02:00
Florian Bruhin
a85ea92a21 Merge branch 'open-editor-all-modes' of https://github.com/kobezda/qutebrowser into kobezda-open-editor-all-modes 2016-09-05 10:59:53 +02:00
Florian Bruhin
366c230e0a Merge branch 'docstrings' of https://github.com/lahwaacz/qutebrowser into lahwaacz-docstrings 2016-09-05 10:58:39 +02:00
Ján Kobezda
da65f7234a Allow :open-editor in modes other than insert
':open-editor' can now be run in all modes.

Resolves #1902
2016-09-04 22:23:16 +02:00
Florian Bruhin
ea4f4e197f Handle elements which are out of view correctly
Fixes #1910
2016-09-04 21:09:15 +02:00
Florian Bruhin
faa052ad6f Fix hang with multiple spaces in URL completion 2016-09-04 20:19:16 +02:00
Jakub Klinkovský
cbe74f6991 fix adblock-update documentation
The tilde has to be escaped, otherwise the HTML is broken.
2016-09-02 19:52:45 +02:00
Jakub Klinkovský
3518fe19e8 move explanation of ;; to commands documentation
The note was out of place in keys.conf as it's not about keyinput. Since
we have a top-level documentation for commands now, let's keep the info
in once place. People will look there anyway for the documentation of
commands they want to bind.
2016-09-02 19:52:45 +02:00
Jakub Klinkovský
f36b8acec1 adjust wording in commands top-level documentation
There is no "commandline" for bindings in keys.conf, so describing it as
for "command arguments" should be more accurate.
2016-09-02 19:52:45 +02:00
Jakub Klinkovský
9669aca7d9 remove random description of variables in commands' docstrings
Full description is given at the top of qute://help/commands.html,
duplicating this for some commands where it might be useful is
unmaintainable.
2016-09-02 19:52:45 +02:00
Florian Bruhin
1cdf90f1c7 pastebin: Start sending API key
This is not enforced on the server yet, but this way we can do so after
a few releases (and break crash reports for older releases).
2016-09-01 22:57:35 +02:00
Florian Bruhin
44d6db4f45 QtWebEngine: Fix crash with userscript + selection
Fixes #1878

Unfortunately it seems impossible to implement a test for this, as
selection via javascript somehow doesn't trigger this.
2016-09-01 22:45:57 +02:00
arza
9b6541638e Update CHANGED_KEY_COMMANDS and test_migrations for sk-keybinding. 2016-09-01 21:05:44 +03:00
arza
a90314985a Fix sk-keybinding. 2016-09-01 16:23:16 +03:00
Rok Mandeljc
469590d4e8 TabWidget: a possible fix for #1693 - grey area under custom tabbar
Attempt to fix the issue #1693 by:
- setting the TabBarStyle to TabWidget in addition to TabBar
- chain up SE_TabWidgetTabBar requests in TabBarStyle.subElementRect
  to the super() rather than self._style, in order to avoid getting
  adwaita-specific rect sizes instead of default ones that are also
  used in rendering.
2016-08-29 14:11:34 +02:00
Florian Bruhin
b9282587d0 Merge branch 'auto-open-fixes' of https://github.com/mlochbaum/qutebrowser into mlochbaum-auto-open-fixes 2016-08-29 07:12:14 +02:00
Florian Bruhin
5917f34eab Merge branch 'settings' of https://github.com/lahwaacz/qutebrowser into lahwaacz-settings 2016-08-29 06:52:17 +02:00
Florian Bruhin
553eaee467 Fix pylint false-positive 2016-08-26 05:21:10 +02:00
Florian Bruhin
2408d76e4c Improve get_console_format docstring 2016-08-25 23:17:10 +02:00
Florian Bruhin
29778bb799 Merge branch 'format-debug-log-level' of https://github.com/ryanjmortenson/qutebrowser into ryanjmortenson-format-debug-log-level 2016-08-25 23:16:36 +02:00
Florian Bruhin
76a3bdd94a Improve message for invalid --logfilter 2016-08-25 23:12:51 +02:00
Florian Bruhin
99daa9e165 Merge branch 'issue1867' of https://github.com/knaggita/qutebrowser into knaggita-issue1867 2016-08-25 23:11:35 +02:00
Florian Bruhin
be7abb53ad cmdutils: Assert on positional-only params 2016-08-25 22:16:25 +02:00
Florian Bruhin
943dc564b2 Fix choices validation with unannotated args
Something like:

    @cmdutils.argument('foo', choices=['one', 'two'])
    def func(foo):
        # ...

didn't actually validate the foo argument, since the inferred type of
the argument is None, and that skipped all conversion (and thus
validation).

Fixes #1871
See #1885

This is a reworked version of 12061b8bb1
which lets special parameters (count/win_id/flags) through correctly.
2016-08-25 22:16:25 +02:00
knaggita
d26566a1f6 Validate loggernames passed to --logfilter 2016-08-24 18:56:18 +03:00
rmortens
384e3d1d88 Add change format for debug-log-level cmd 2016-08-24 08:40:11 -06:00
knaggita
0b60d28742 Validate loggernames passed to --logfilter 2016-08-24 17:09:34 +03:00
knaggita
cf1dc28214 Validate logger names passed to --logfilter 2016-08-24 16:12:32 +03:00
knaggita
848af2e294 Validation of logger names passed to --logfilter 2016-08-24 15:15:20 +03:00
Florian Bruhin
445d287955 Revert "Fix choices validation with unannotated args"
This reverts commit 12061b8bb1.
2016-08-23 23:34:02 +02:00
Florian Bruhin
12061b8bb1 Fix choices validation with unannotated args
Something like:

    @cmdutils.argument('foo', choices=['one', 'two'])
    def func(foo):
        # ...

didn't actually validate the foo argument, since the inferred type of
the argument is None, and that skipped all conversion (and thus
validation).

Fixes #1871
See #1885
2016-08-23 22:01:21 +02:00
Florian Bruhin
8643f6f28d Add explicit else in :completion-item-focus
See #1885
2016-08-23 20:49:56 +02:00
Florian Bruhin
a17b8bec90 Don't treat "Hello." as URL with auto-search=naive 2016-08-23 09:02:39 +02:00
Jakub Klinkovský
1411c287c5 qute://settings: set valid type of <input> fields
fixes #1883
2016-08-22 21:09:57 +02:00
Marshall Lochbaum
44411e02c6 Replace != with (is not) when testing whether a model is new 2016-08-22 13:02:13 -04:00
Marshall Lochbaum
2aef26c58b Linting 2016-08-21 23:22:46 -04:00
Marshall Lochbaum
cbecd48871 Refactor Completer/CompletionView interface, removing set_pattern() 2016-08-21 22:56:18 -04:00
Marshall Lochbaum
c5ca102d93 Fix completion flicker on quick-complete with show=auto 2016-08-20 01:01:12 -04:00
Marshall Lochbaum
08b348be50 Merge branch 'master' into auto-open-fixes 2016-08-19 22:50:26 -04:00
Florian Bruhin
fe11e25430 Ignore mouse events going to non-main widgets
When we hide the context menu on QtWebEngine, we get a mouse event
relative to the QMenu in the filter, which means tab.elements.at_pos
will get called with a negative position (and thus assert) or at least a
wrong position.
2016-08-19 18:38:07 +02:00
Florian Bruhin
bcb06f0cc6 Fix lint 2016-08-19 15:47:35 +02:00
Florian Bruhin
1cfadbf034 Fix / ? : bindings
This was broken in #1859 and I didn't notice...
2016-08-19 15:35:20 +02:00
Florian Bruhin
e074192cc4 Update docs 2016-08-19 15:27:56 +02:00
Florian Bruhin
7e3d1ccd24 Simplify :debug-log-filter implementation 2016-08-19 15:08:15 +02:00
Florian Bruhin
e1cd905163 Move :window-only below :debug-log-* in utilcmds 2016-08-19 15:06:08 +02:00
Florian Bruhin
71b0876188 Improve :debug-log-filter message
This changes the message so it resembles the default choices=... one,
and also changes the argument to "filters" because that sounds nicer as
a metavar.
2016-08-19 15:03:19 +02:00
Florian Bruhin
fd0965703e Remove log.change_loglevel 2016-08-19 14:57:55 +02:00
Florian Bruhin
75c3b1a9f8 Fix test for :debug-log-level with invalid level
Since we're getting dictionary keys in choices=..., we need to sort them
so we get a consistent message.
2016-08-19 14:57:21 +02:00
knaggita
1d5a3a6175 Add :debug-loglevel :debug-logfilter commands 2016-08-19 14:12:19 +02:00
Florian Bruhin
d25fde4f29 Whoops... 2016-08-19 13:42:38 +02:00
Florian Bruhin
29cd878902 Fix lint 2016-08-19 13:40:21 +02:00
nanjekyejoannah
056c0c3c14 Make command keys configurable
Fixes #672
2016-08-19 13:40:21 +02:00
Florian Bruhin
8eb8039370 Merge branch 'rewrite-pP' of https://github.com/blyxxyz/qutebrowser into blyxxyz-rewrite-pP 2016-08-19 13:36:33 +02:00
Florian Bruhin
388d771a2e Use send_event with postpone=True in webelem.click
For some reason, since 0557fea79e we're
getting segfaults in misc.feature...
2016-08-19 10:23:10 +02:00
Florian Bruhin
4362d42c50 Add postpone argument to AbstractTab.send_event 2016-08-19 10:13:07 +02:00
Florian Bruhin
a846a5b89f Move send_event to AbstractTab
This means subclasses only need to implement _event_target.
2016-08-19 10:12:57 +02:00
Florian Bruhin
a40dd7edf6 Allow empty string for tabs -> title-format 2016-08-19 08:31:36 +02:00
Florian Bruhin
8da942ddc7 bdd: Skip tests on WebEngine causing memory leaks 2016-08-18 22:46:32 +02:00
Florian Bruhin
0557fea79e Use QApplication.sendEvent instead of postEvent
From the QApplication.postEvent docs:
http://doc.qt.io/qt-5/qcoreapplication.html#postEvent

  The event must be allocated on the heap since the post event queue
  will take ownership of the event and delete it once it has been
  posted. It is not safe to access the event after it has been posted.

We can't reliably guarantee that from Python, so we need to use
sendEvent instead.
2016-08-18 21:36:43 +02:00
Florian Bruhin
ccc676c04f Handle CommandError in show_source_cb 2016-08-18 19:32:16 +02:00
Jan Verbeek
b6c96855c8 Rewrite paste -s/pP 2016-08-18 19:05:35 +02:00
Florian Bruhin
c0ffcfc585 QtWebEngine: Make :fake-key work 2016-08-18 18:44:33 +02:00
Florian Bruhin
dfed2f9c9c WebEngine: Don't save title if generated from URL 2016-08-18 18:05:48 +02:00
Florian Bruhin
2a0e503644 QtWebEngine: Don't raise CommandError with no hint 2016-08-18 17:47:05 +02:00
Florian Bruhin
205c12c530 Fix docs for :click-element 2016-08-18 16:58:56 +02:00
Florian Bruhin
927f378c6d Fix eslint 2016-08-18 16:52:53 +02:00
Florian Bruhin
73210fb87c QtWebEngine: Fix tab passed to WebEngineElement 2016-08-18 16:25:58 +02:00
Florian Bruhin
4345d60ff1 Revert "javascript.assemble: Support document module"
This reverts commit afc7faabda.

This isn't actually needed as we can't use document.getElementById()
directly without serializing anyways.
2016-08-18 15:58:46 +02:00
Florian Bruhin
1956480164 Revert "Handle {} elements in elements._js_cb_single"
This reverts commit f59a9d37252599c8fbda4cc687bd9f094c6d05b9.

Since we're now using a webelem function, this isn't needed anymore.
2016-08-18 15:58:46 +02:00
Florian Bruhin
dbb3929bf3 QtWebEngine: Serialize element correctly (find_id) 2016-08-18 15:58:46 +02:00
Florian Bruhin
f98820971d Handle {} elements in elements._js_cb_single
When using document.getElementById like in find_id, we can get {}
instead of null/None back when nothing was found.
2016-08-18 15:58:46 +02:00
Florian Bruhin
d9d14d4a4c Fix lint 2016-08-18 15:58:46 +02:00
Florian Bruhin
e0af03db80 Add a default target for :click-element 2016-08-18 15:58:46 +02:00
Florian Bruhin
0cef4ac2db Add a :click-element command 2016-08-18 15:30:04 +02:00
Florian Bruhin
28a6b3918c Fix lint 2016-08-18 14:42:42 +02:00
Florian Bruhin
e851839973 Don't make HintActions a QObject
It probably still makes sense for HintManager to be one for the moment
though, as it's in the objreg.
2016-08-18 14:39:13 +02:00
Florian Bruhin
0d1ea0b93a Add FIXME for webkitelem.focus_elem 2016-08-18 14:33:55 +02:00
Florian Bruhin
63c66945a4 Add webelem.click() and webelem.hover() 2016-08-18 14:32:19 +02:00
Florian Bruhin
5ac9fe9c32 Add tab.elem.find_id 2016-08-18 14:08:34 +02:00
Florian Bruhin
afc7faabda javascript.assemble: Support document module 2016-08-18 14:07:21 +02:00
Florian Bruhin
2c6fe35398 Fix blank lines 2016-08-18 14:03:27 +02:00
Florian Bruhin
a0add7b66c Get rid of tab.run_js_blocking
We had some trouble with it, and it's not actually needed.
2016-08-18 14:02:59 +02:00
Florian Bruhin
d3084dd690 Add a separate tab.elements object 2016-08-18 14:01:27 +02:00
Florian Bruhin
1ec59f3f0e Add FIXME 2016-08-18 12:46:55 +02:00
Florian Bruhin
9226e3eece QtWebEngine: Implement only_visible for find_all 2016-08-18 12:40:21 +02:00
Florian Bruhin
30029a8259 utils.javascript: Handle bools in _convert_js_arg 2016-08-18 12:40:21 +02:00
Florian Bruhin
b596c4da27 eslint: Enable long lines with URLs 2016-08-18 12:40:21 +02:00
Florian Bruhin
274fe58d6d Simplify webelem.js
serialize_elem() now takes care of assigning IDs.
2016-08-18 12:40:21 +02:00
Florian Bruhin
0d35502e87 Use HintingError for all hinting errors 2016-08-18 12:40:21 +02:00
Florian Bruhin
eabac17c58 Combine hint signals into a single one 2016-08-18 12:40:21 +02:00
Florian Bruhin
39fd6a6062 QtWebEngine: Adjust hints according to zoom 2016-08-18 12:40:21 +02:00
Florian Bruhin
30f6afc2aa Pass tab to WebEngineElement 2016-08-18 12:40:21 +02:00
Florian Bruhin
53e747d7ea Disable download hints for QtWebEngine 2016-08-18 12:40:21 +02:00
Florian Bruhin
58d2d30e9a Add initial hinting implementation 2016-08-18 12:40:21 +02:00
Florian Bruhin
1b3d693a5e Add post_event to tab API 2016-08-18 12:40:21 +02:00
Florian Bruhin
6f24221c54 Replace WebElement.frame() by .has_frame() 2016-08-18 12:40:21 +02:00
Florian Bruhin
91b43c5cef hints: Use tab API to move cursor for input fields 2016-08-18 12:40:21 +02:00
Florian Bruhin
62db0095d1 Revert "Make webelem.rect_on_view work async"
This reverts commit 4e11613d2df064b138532c18f88bbf278c64f347.

We can actually make this synchronous just fine by collecting that
information when searching for the elements...
2016-08-18 12:40:21 +02:00
Florian Bruhin
e6d6302958 Make webelem.rect_on_view work async
WebKitElement still has an internal sync version used for is_visible,
but hopefully we can get rid of that soon too.
2016-08-18 12:40:21 +02:00
Florian Bruhin
aba1556324 Remove old comment 2016-08-18 12:40:21 +02:00
Florian Bruhin
343b2d8385 Remove old FIXME 2016-08-18 12:40:21 +02:00
Florian Bruhin
15dcd5284c Enable :hint for QtWebEngine 2016-08-18 12:40:21 +02:00
Florian Bruhin
8eaa387f21 Adjust default hint.bg gradient orientation 2016-08-17 21:00:13 +02:00
Florian Bruhin
52e47e0c3d Add HintLabel.__repr__ 2016-08-17 15:32:24 +02:00
Florian Bruhin
955ed2f52d Simply connect HintLabel._move_to_elem to signal 2016-08-17 15:32:24 +02:00
Florian Bruhin
1d82ea8740 Remove logging in _on_contents_size_changed
Otherwise this will be logged once for every element.
2016-08-17 15:32:24 +02:00
Florian Bruhin
d87a255c0a Don't fully clean up labels if their frame is gone
Otherwise they're invalid but still in the HintContext, so calling
.hide() on it later (e.g. because the user pressed another key) would
give us a RuntimeError from PyQt.
2016-08-17 15:32:24 +02:00
Florian Bruhin
0293307d61 Remove adjust_zoom for webelem.rect_on_view
Previously, the drawn hint labels were affected by the zoom, i.e., they
were stretched out by QtWebKit and actually had to be drawn at the
unzoomed position.

The Python/C++ API gives us coordinated adjusted for zoom, so
we always *negatively* adjusted them to get the unzoomed coordinates.

JS gave us the original coordinates, so we stretched them out according
to the zoom if adjust_zoom was given (which means only when clicking a
link).

Now we always operate in term of display coordinates: The point where we
draw the hint label is equal to the point we're clicking.

Thus, the zoom level for javascript is always adjusted, and the Python
zoom level is never (negatively) adjusted.
2016-08-17 14:51:05 +02:00
Florian Bruhin
7c17af3889 Use ${_monospace} for default hints font 2016-08-17 14:51:05 +02:00
Florian Bruhin
373eca1ad2 Fix some corner cases in _transform_hint_color 2016-08-17 14:51:05 +02:00
Florian Bruhin
eac30fc84b Add styling of new hints
This also removes the hints -> opacity setting, as this is now set by
using an rgba(...) color.
2016-08-17 14:51:05 +02:00
Florian Bruhin
c033ed9edb Allow config value transformers to give up 2016-08-17 14:51:04 +02:00
Florian Bruhin
9c3807c117 Store HintLabels (not ElemTuples) in HintManager 2016-08-17 14:44:49 +02:00
Florian Bruhin
cf7170a33b Remove no longer needed webelem methods
The following methods were only used for hint labels and thus removed
now:

- document_element
- create_inside
- find_first
- set_inner_xml
- remove_from_document
- set_style_property
2016-08-17 14:44:49 +02:00
Florian Bruhin
1753d3507c Use native QLabels for hints
This will make labels work easily with QtWebEngine, and make sure
they're not affected by the page's contents.

Fixes #925.
Fixes #1126.
2016-08-17 14:43:35 +02:00
Florian Bruhin
781e7554e4 Set open target for force_tab to tab-silent
Fixes #1328
2016-08-17 12:04:46 +02:00
Florian Bruhin
01fd7cd210 Merge branch 'issue1060' of https://github.com/haasn/qutebrowser into haasn-issue1060 2016-08-17 12:01:53 +02:00
Florian Bruhin
cc693f17ca QtWebEngine: Use loadFinished as history trigger
Using urlChanged spams the history with too many entries...

Fixes #1837
2016-08-16 21:46:25 +02:00
Florian Bruhin
1dbedbc474 Fix :restart deleting the given --basedir 2016-08-16 21:27:23 +02:00
Florian Bruhin
87aa11de7f Remove unused WebView._check_insertmode attribute 2016-08-16 19:57:43 +02:00
Florian Bruhin
1138d068e6 Move insert-mode-on-click to tab API / mouse.py
This also implements the feature for QtWebEngine.
2016-08-16 16:22:18 +02:00
Florian Bruhin
eef76dde86 eslint: Disable no-warning-comments 2016-08-16 15:21:37 +02:00
Florian Bruhin
6794187390 Fix too long line 2016-08-16 14:19:39 +02:00
Florian Bruhin
5d6abc6f67 Merge branch 'safe-args' of https://github.com/blyxxyz/qutebrowser into blyxxyz-safe-args 2016-08-16 14:18:44 +02:00
Florian Bruhin
dba579c202 Update user-agent completion list 2016-08-16 14:06:57 +02:00
Jan Verbeek
cfd166a95e Merge https://github.com/The-Compiler/qutebrowser into safe-args 2016-08-16 14:05:04 +02:00
Jan Verbeek
096387897c Make pp bindings work with option in clipboard
If the clipboard contains "-a" then "open {clipboard}" will fail because
-a gets parsed as an option. "open -- {clipboard}" doesn't do that. See
some comments in #1791.
2016-08-16 14:00:37 +02:00
Florian Bruhin
f4b72d4b24 Revert "Revert "Handle counts for special keys.""
This reverts commit 2d5ffbfd02.
2016-08-16 13:44:28 +02:00
Florian Bruhin
5ecef0004c Add some docs for command replacements 2016-08-16 13:32:53 +02:00
Florian Bruhin
8d6b905f95 Merge branch 'insert-text' of https://github.com/blyxxyz/qutebrowser into blyxxyz-insert-text 2016-08-16 13:29:42 +02:00
Florian Bruhin
8e6d784fd7 Merge branch 'fix_hints_autofollow' of https://github.com/lahwaacz/qutebrowser into lahwaacz-fix_hints_autofollow 2016-08-16 12:58:56 +02:00
Niklas Haas
c2cc28a72b
Add new-instance-open-target.window = first-opened
Fixes #1060.

In the process of adding this, I also decided to rewrite
mainwindow.get_window() for clarity (and also because flake8 was warning
about complexity).

Also adds some tests to the new-instance-target mechanism, in particular
a specific test for the issue in question.
2016-08-16 12:24:38 +02:00
Florian Bruhin
cf0b12b5a9 Merge branch 'var_replacements' of https://github.com/lahwaacz/qutebrowser into lahwaacz-var_replacements 2016-08-16 11:49:31 +02:00
Florian Bruhin
ee3ea739fc Merge branch 'completion-category-focus' of https://github.com/rcorre/qutebrowser into rcorre-completion-category-focus 2016-08-16 11:45:23 +02:00
Florian Bruhin
91db564e1a Fix lint 2016-08-16 11:36:55 +02:00
Florian Bruhin
d1138fa342 Update docs 2016-08-16 11:22:29 +02:00
Florian Bruhin
380856bcb2 Merge branch 'navigate-count' of https://github.com/pvsr/qutebrowser into pvsr-navigate-count 2016-08-16 11:21:07 +02:00
Florian Bruhin
882d1a5e88 Move :window-only to misc.utilcmds 2016-08-16 11:05:02 +02:00