Commit Graph

2018 Commits

Author SHA1 Message Date
nanjekyejoannah
d3e19ec8fc Add general -> yank-ignored-url-parameters 2016-09-06 18:19:40 +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
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
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
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
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
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ý
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
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
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
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
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
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
73210fb87c QtWebEngine: Fix tab passed to WebEngineElement 2016-08-18 16:25:58 +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
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
9226e3eece QtWebEngine: Implement only_visible for find_all 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
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
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
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
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
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
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
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
Peter Rice
67609af21b resolve linter warnings 2016-08-15 22:53:28 -04:00
Peter Rice
060305279c update navigate-related help and function docs 2016-08-15 22:28:25 -04:00
Peter Rice
d3e4d62d14 make navigate take counts for inc, dec, and up 2016-08-15 21:13:52 -04:00
Michael Hoang
c0ab474b21 Give error when trying to detach a single tab 2016-08-16 07:36:39 +10:00
Florian Bruhin
af5d166ae1 QtWebEngine: Fix error message with :print --pdf 2016-08-11 19:13:45 +02:00
Florian Bruhin
fb07655e56 Move input -> rocker-gestures to MouseEventFilter 2016-08-11 18:51:51 +02:00
Florian Bruhin
e8980d01e6 MouseEventFilter: Don't pass obj to handlers 2016-08-11 18:51:50 +02:00
Florian Bruhin
9195e6a3a7 Fix :follow-selected --tab 2016-08-11 17:50:19 +02:00
Florian Bruhin
59faee8518 Don't return page from WebView._init_page
We don't need to refer to it anymore.
2016-08-11 16:48:27 +02:00
Florian Bruhin
d6a3134b3e Remove unused imports 2016-08-11 16:38:45 +02:00
Florian Bruhin
ad1e1e5f92 Log is_main_frame in acceptNavigationRequest 2016-08-11 16:36:41 +02:00
Florian Bruhin
421b14681f Move HintManager out of WebView
This moves creating the HintManager to AbstractTab, and lets
TabData (which is now a QObject) handle the start_hinting/end_hinting
signal.

For the mouse_event signal of HintManager, we now have a slot in
AbstractTab too, though that might actually be moved to
WebKitTab/WebEngineTab later when needed.
2016-08-11 16:30:55 +02:00
Florian Bruhin
3bffb71b55 QtWebEngine: Implement mouse opentarget handling
This moves various stuff around and out of QtWebKit code:

- open_target and hint_target are now in TabData, not on the WebPage

- As much as possible got extracted from WebPage.acceptNavigationRequest
  to AbstractTab._on_link_clicked, with a new link_clicked signal added
  to WebPage. However, we need to decide whether to handle the request
  in this tab or not inside acceptNavigationRequest, so we have some
  code duplicated there and in WebEnginePage.acceptNavigationRequest.

- _mousepress_opentarget (i.e., setting the open_target) is now handled
  in MouseEventFilter, not in WebView.
2016-08-11 16:09:59 +02:00
Florian Bruhin
8b0028cb87 Add FIXME 2016-08-11 14:55:19 +02:00
Florian Bruhin
1a94cb551c Move mouse wheel zooming to MouseEventHandler 2016-08-11 13:50:06 +02:00
Florian Bruhin
677bb29251 Document event filter attributes 2016-08-11 13:38:20 +02:00
Michael Hoang
af97f9efae Add add_undo parameter for closing tabs
By default, closed tabs should be undoable, but when a tab is detached
:undo should not reopen that tab in the old window.
2016-08-11 07:44:11 +10:00
Jan Verbeek
d2d92c9f2e Fix docstring 2016-08-10 22:29:19 +02:00
Jan Verbeek
4966debd61 Deprecate :paste-primary to :insert-text {primary} 2016-08-10 21:55:16 +02:00
Jan Verbeek
db0f8fffcd Merge https://github.com/The-Compiler/qutebrowser into insert-text 2016-08-10 20:54:54 +02:00
Florian Bruhin
57896dc00e Merge branch 'clip' of https://github.com/blyxxyz/qutebrowser into blyxxyz-clip 2016-08-10 20:38:54 +02:00
Florian Bruhin
b801d3316d Fix lint 2016-08-10 20:23:41 +02:00
Florian Bruhin
64afc562b6 Install MouseEventFilter on new WebEngine children
For some reason, when e.g. visiting duckduckgo and then heise.de,
QtWebEngine suddenly gets a new QOpenGLWidget as focusProxy.

We install an extra eventFilter observing the ChildAdded event and
re-adding the MouseEventFilter when that happens.
2016-08-10 19:44:06 +02:00
Jakub Klinkovský
cdcc9996a0 hints: remove unused context attribute and duplicate initialization 2016-08-10 19:37:01 +02:00
Jakub Klinkovský
58ded41e5d hints: move _filterstr into _context 2016-08-10 18:48:10 +02:00
Jakub Klinkovský
efb680dfb1 hints: make HintManager.fire private
It's not called by other classes anymore, it shouldn't be part of public
API because wrong value to the keystr parameter causes KeyError.
2016-08-10 18:21:19 +02:00
Florian Bruhin
29b778b6d6 Use javascript.assemble for all functions 2016-08-10 17:27:34 +02:00
Florian Bruhin
f908d29a5f Move mouse handling to an EventFilter 2016-08-10 16:44:40 +02:00
Jakub Klinkovský
24f8ed8ac1 hints: refactor auto-follow handling in the fire method 2016-08-10 16:09:37 +02:00
Florian Bruhin
5b2ae3cec7 Don't inherit AbstractWebInspector from QtWebKit 2016-08-10 14:55:50 +02:00
Florian Bruhin
33193d7dd4 Split up QtWebKit specific part in browser.history 2016-08-10 14:51:29 +02:00
Florian Bruhin
ad5008152c Move browser.webkit.history to browser.history 2016-08-10 14:45:52 +02:00
Florian Bruhin
393178262e Add history support for QtWebEngine 2016-08-10 13:15:34 +02:00
Florian Bruhin
77531d09df Move history triggering out of WebView 2016-08-10 13:14:38 +02:00
Florian Bruhin
eed3460317 Add tab.url(requested=True) to get original URL 2016-08-10 13:14:07 +02:00
Jakub Klinkovský
0d4322b1f2 fix braces in boolean assignments 2016-08-10 13:01:41 +02:00
Jakub Klinkovský
a31565f46e hints: make auto-follow a quadruple option instead of binary 2016-08-10 12:40:16 +02:00
Jan Verbeek
63b9b61e75 Add ClipboardError superexception 2016-08-10 12:33:01 +02:00
Jakub Klinkovský
7be942fadc hints: fix leaving filter in number mode 2016-08-10 11:18:11 +02:00
Niklas Haas
e0f069f7ca
Extract hint tags from <textarea>
This is similar to <input> and also often uses a placeholder or name to
identify itself.
2016-08-10 02:07:33 +02:00
Jan Verbeek
7d0064ff86 Fix docstrings 2016-08-09 19:23:38 +02:00
Jakub Klinkovský
108d735e07 hints: fix corner-case in _hint_strings 2016-08-09 18:12:07 +02:00
Jakub Klinkovský
ec5387c674 hints: fix docstrings 2016-08-09 18:09:50 +02:00
Jakub Klinkovský
9841b01d0d hints: generalize auto-follow for any unique match
fixes #1809
2016-08-09 18:09:50 +02:00
Jakub Klinkovský
1d2a34812b hints: refactor handling of auto-follow option 2016-08-09 18:09:50 +02:00
Jakub Klinkovský
cdcde09b80 hints: refactor filter_hints method 2016-08-09 18:09:47 +02:00
Florian Bruhin
fb3da578c5 Fix lint 2016-08-09 17:28:14 +02:00
Florian Bruhin
809f8e90df Merge branch 'fix_hiding_hints' of https://github.com/lahwaacz/qutebrowser into lahwaacz-fix_hiding_hints 2016-08-09 16:42:11 +02:00
Jan Verbeek
7e634a1e52 Make vars declarative, new function for URL lists 2016-08-09 16:20:02 +02:00
Florian Bruhin
5066606ddc Remove spaces inside docstrings 2016-08-09 16:15:23 +02:00
Florian Bruhin
13f80e3f63 Merge branch 'hintmodes' of https://github.com/haasn/qutebrowser into haasn-hintmodes 2016-08-09 16:14:07 +02:00
Florian Bruhin
fefea4944a QtWebEngine: Make :open-editor work 2016-08-09 16:00:59 +02:00
Niklas Haas
62e58c0ab9
Add a --mode flag to :hints
This allows a specific keybinding, for whatever reason, to override the
default mode. Examples of when this could be useful:

* :hint --rapid --mode=word  (to type them more rapidly)
* :hint --mode=letter input  (if the default mode is number)

Also reword the description of 'group' to make the distinction between
'group' and 'mode' clearer.
2016-08-09 15:34:13 +02:00
Florian Bruhin
9f770adc78 Lower-case WebEngineElement.tag_name() correctly 2016-08-09 15:19:57 +02:00
Jan Verbeek
8e4733f483 Merge https://github.com/The-Compiler/qutebrowser into clip 2016-08-09 14:36:01 +02:00
Florian Bruhin
4046615b37 WebEngineScroller: Set position to (0,0) initially
Since we now use QWebEngineScript, we can't easily know when the script
finished running and we can access window._qutebrowser.scroll.

We instead assume the initial position (if we don't get a
scrollPositionChanged) will always be (0, 0), and explicitly set it
to (None, None) (displaying ???) if we can't connect that signal.
2016-08-09 13:18:33 +02:00
Florian Bruhin
6b7a39685e Modularize javascript code
We now load the JS code as a QWebEngineScript, which sets up
window._qutebrowser with various "modules". That means we don't have to
pass the whole module every time we want to execute something.
2016-08-09 13:17:44 +02:00
Jakub Klinkovský
7271955c56 make hiding unmatched rapid hints configurable 2016-08-09 11:01:58 +02:00
Florian Bruhin
c3690bce0d Merge branch 'hinttags' of https://github.com/haasn/qutebrowser into haasn-hinttags 2016-08-09 08:43:32 +02:00
Jakub Klinkovský
1819b46fe0 suppress hiding hints in rapid mode
fixes #1799
2016-08-08 18:41:25 +02:00
Niklas Haas
6e279f1b1e
Extract hint tags from <button> text
This is useful for some styled buttons, including some of those found on
GitHub.
2016-08-08 17:49:35 +02:00
Niklas Haas
cf26201e86 Extract hint tags from <input placeholder="text">
This is useful for very many input fields, especially prominent on
GitHub itself.
2016-08-08 17:49:18 +02:00
Florian Bruhin
af8302b678 Remove unused import 2016-08-08 16:32:23 +02:00
Florian Bruhin
9a17591fb7 Start getting :open-editor to work with WebEngine
It doesn't actually work yet (as it claims the field is not editable),
but at least does not crash when the backend limitation for the command
is removed.
2016-08-08 16:24:34 +02:00
Florian Bruhin
3c573ac187 Fix upper-case tag names for WordHinter 2016-08-08 15:13:30 +02:00
Florian Bruhin
b8e2d5f8f6 Add initial WebEngineElement implementation
This allows :navigate prev/next to work correctly via the javascript
bridge.
2016-08-08 15:02:58 +02:00
Florian Bruhin
1c73751fd9 Always lowercase tagName 2016-08-08 14:11:01 +02:00
Florian Bruhin
9bcce37ff3 WebEngine: Allow :navigate up/decrement/increment 2016-08-08 14:09:28 +02:00
Florian Bruhin
0b16a36120 Clean up handling of focus element
Also fixes #1359.
2016-08-08 14:05:30 +02:00
Florian Bruhin
27330bd4d1 Fix :search-prev with QtWebEngine
Fixes #1797
2016-08-08 13:51:42 +02:00
Florian Bruhin
dfbadaf7c2 Split WebElementWrapper into abstract/webkit parts 2016-08-08 13:04:53 +02:00
Jan Verbeek
864c95007f Unhide :insert-text and allow outside insert mode
:insert-text works if a text element is focused, even outside insert
mode.
2016-08-07 14:29:52 +02:00
Jan Verbeek
ebfe23c376 Merge https://github.com/The-Compiler/qutebrowser into clip
Also make it possible to use multiple variables in one argument.
2016-08-07 13:14:46 +02:00
Florian Bruhin
96087bd554 Fix up pretty URL yanking 2016-08-07 11:40:26 +02:00
Florian Bruhin
b6fbd3ce3a Merge branch 'better-variables' of https://github.com/blyxxyz/qutebrowser into blyxxyz-better-variables 2016-08-07 11:33:01 +02:00
Florian Bruhin
88d3e86259 Use "what != 'url-pretty'" 2016-08-07 11:02:50 +02:00
Jan Verbeek
dc69a90e69 Add :insert-text command
See #1790.
:paste-primary now calls :insert-text and can be deprecated by
:insert-text {primary} after #1791 is merged.
2016-08-07 02:46:10 +02:00
Marshall Lochbaum
47969362e1 Fix minor conditional issues in yank 2016-08-06 20:15:51 -04:00
Marshall Lochbaum
a90662ef83 Fix combined yank documentation 2016-08-06 20:13:50 -04:00
Jan Verbeek
38508274e0 Improve clipboard exceptions, migrate bindings 2016-08-07 00:46:23 +02:00
Jan Verbeek
96146c55af Remove useless clipboard target information 2016-08-06 22:25:08 +02:00
Jan Verbeek
0177dafbd0 Add {clipboard} and {primary} to replace :paste
:paste is deprecated and replaced by equivalents using :open and the
new variables, and :open supports opening newline-separated lists of
URLs.
2016-08-06 22:03:50 +02:00
Marshall Lochbaum
54ba27cf77 Merge :yank-selected into :yank (fixes #820)
Changes :yank's flag arguments to a positional "what" argument
specifying the object to be yanked. Including "selection" as a
possibility allows for the replacement of :yank-selected with
:yank selection.
2016-08-05 22:01:17 -04:00
Jan Verbeek
1e97247c63 Revert spawn's splitting, blacklist from doc
Blacklist spawn from getting the no_replace_variables doc note.
2016-08-05 18:04:14 +02:00
Florian Bruhin
778ccad39f Move most :navigate code to browser.navigate 2016-08-05 17:28:48 +02:00
Florian Bruhin
68595e1736 Make sure base URL for resolve_url is absolute 2016-08-05 17:12:09 +02:00
Florian Bruhin
7a65559cce Move hints._resolve_url to a WebElement method 2016-08-05 17:09:52 +02:00
Jan Verbeek
8a527b5faf Make :spawn parse normally without maxsplit 2016-08-05 16:52:47 +02:00
Florian Bruhin
e2ae133757 Split up HintActions from HintManager 2016-08-05 12:37:25 +02:00
Florian Bruhin
d8521f43ee Change tab.find_all_elements() to be async 2016-08-05 12:37:25 +02:00
Florian Bruhin
94cf3fa4ff QtWebEngine: Restore Qt 5.6 compatibility 2016-08-04 21:33:53 +02:00
Florian Bruhin
029ea2e5a7 Add miscwidgets.WrapperLayout.wrap
This makes it easier for an user of WrapperLayout to wrap a widget.
2016-08-04 19:22:44 +02:00
Florian Bruhin
7b211e0b65 QtWebEngine: Run javascript in ApplicationWorld
This means the JS context will be isolated from the webpage itself, and
the webpage won't be able to access things we define.
2016-08-04 18:14:29 +02:00
Florian Bruhin
08b70f0f4c Add qutebrowser.utils.javascript
webelem.javascript_escape got renamed to javascript.string_escape, and a
new javascript.assemble got added to make it easier to call a function
inside a .js file.
2016-08-04 17:53:13 +02:00
Florian Bruhin
6021dc6394 Merge branch 'open-download-fixes' of https://github.com/Kingdread/qutebrowser into Kingdread-open-download-fixes 2016-08-04 12:46:44 +02:00
Florian Bruhin
764c232033 Split inspector into web{engine,kit}inspector 2016-08-04 12:44:46 +02:00
Daniel Schadt
d21b42662d Minor Text Fixes
default (program) -> default application
surround {} with backticks
mention that the filename will be appended in the docstrings
2016-08-04 12:07:51 +02:00
Daniel Schadt
017bfc9b9c open-download: append filename if no {} is found
This allows shortcuts like ":download-open gvim" instead of
":download-open gvim {}" to work.
2016-08-04 11:50:35 +02:00
Jan Verbeek
c7c5a98506 Allow {url} and {url:pretty} as parts of arguments
This makes commands like `:open web.archive.org/web/{url}` possible.
This commit also adds a no_replace_variables command register argument
that stops the replacement from happening, which is important for
commands like `:bind` and `:spawn` that take a command as an argument.
2016-08-04 02:43:02 +02:00
Daniel Schadt
5ca8f77fca lint fixes 2016-08-03 18:16:28 +02:00
Daniel Schadt
71102cceb0 docstring & documentation fixes 2016-08-03 18:06:28 +02:00
Daniel Schadt
e8bfc25bbc downloads: replace placeholder in cmdline
This allows commands like --file={} to work properly.
2016-08-03 17:59:32 +02:00
Daniel Schadt
a85227fa25 download-open: add cmdline parameter 2016-08-03 17:59:32 +02:00
Daniel Schadt
fa6c552d7b add an application param for prompt-open-download 2016-08-03 17:59:32 +02:00
Daniel Schadt
716ce701f5 utils: move elide_filename to own function
Also increase the elide limit in TempDownloadManager to 50, since that's
probably still enough for all systems.
2016-08-03 17:59:32 +02:00
Florian Bruhin
33677a8449 More pylint pragmas for QtWebEngine 2016-08-03 17:43:22 +02:00
Florian Bruhin
23ce4561c8 Fix lint 2016-08-03 16:48:48 +02:00
Florian Bruhin
0ddb27709d Re-add geometry saving code to WebEngine inspector 2016-08-03 16:29:46 +02:00
Florian Bruhin
61e0c8327a Don't access QWES.globalSettings() on module-level
Otherwise we implicitly create a webengine context, which means setting
QTWEBENGINE_REMOTE_DEBUGGING won't work anymore.
2016-08-03 15:32:56 +02:00
Florian Bruhin
614893bdd6 Initial broken inspector support for QtWebEngine 2016-08-03 15:23:32 +02:00
Florian Bruhin
dbccb12b49 Move WrapperLayout to miscwidgets 2016-08-03 13:08:25 +02:00
Florian Bruhin
5f5b395343 pylint: Ignore failing QtWebEngineWidgets import 2016-08-03 12:16:13 +02:00
Florian Bruhin
11e7f7c334 Remove unused imports 2016-08-03 11:37:05 +02:00
Florian Bruhin
cae7eead6f QtWebEngine: Basic settings support 2016-08-03 11:35:08 +02:00
Florian Bruhin
1fb4aa3532 Merge branch 'tab-open-implicit' of https://github.com/mlochbaum/qutebrowser into mlochbaum-tab-open-implicit 2016-08-03 09:16:49 +02:00
Florian Bruhin
79d2116b18 Remove unneeded 'return' 2016-08-03 09:07:12 +02:00
Florian Bruhin
77dd2a105f Add cmdutils.check_overflow in _set_current_index 2016-08-03 08:57:05 +02:00
Marshall Lochbaum
299d4865d0 Move --implicit flag argument to the end of _open 2016-08-02 15:26:49 -04:00
Marshall Lochbaum
66adbc9323 Add --implicit flag to :open 2016-08-02 13:49:25 -04:00
Marshall Lochbaum
d30da4f905 Update tab_focus docstring 2016-08-02 11:50:21 -04:00
Marshall Lochbaum
8a127f2839 Remove cmdutils.arg_or_count 2016-08-02 11:31:03 -04:00
Florian Bruhin
a3047008dd Bump up filename length limit to 50
The usual limit seems to be 255 bytes, so even when assuming 5-byte
UTF-8 chars for every letter, 50 should be fine.

http://serverfault.com/questions/9546/filename-length-limits-on-linux/9548#9548
2016-08-02 16:12:09 +02:00
Florian Bruhin
b8ef6fa44e Merge branch 'open-download-fixes' of https://github.com/Kingdread/qutebrowser into Kingdread-open-download-fixes 2016-08-02 16:11:34 +02:00
Florian Bruhin
43ff1b0d97 Tunnel private-browsing to QtWebKit correctly 2016-08-02 14:19:31 +02:00
Daniel Schadt
57ceaeeb55 open-download: don't crash on download cancel
Fixes #1728.
2016-08-02 01:10:40 +02:00
Daniel Schadt
b187b680cb open-download: force encoding for filename
Fixes #1726.
2016-08-02 01:00:57 +02:00
Daniel Schadt
abcdaa9cce open-download: make sure the name is not too long
Fixes #1725.

Make sure that the temporary filename is not too long by restricting the
suggested part to 20 characters.
2016-08-02 00:57:22 +02:00
Daniel Schadt
9973cd5037 downloads: don't crash on OSError in open-download
Fixes the crash in #1725, but does not provide a solution. The browser
won't crash, but the file won't be downloaded and opened either.
2016-08-02 00:46:59 +02:00
Florian Bruhin
49699be44e Ignore TypeError on contents_size_changed cleanup 2016-08-01 17:40:41 +02:00
Florian Bruhin
81d0d64731 QtWebEngine: Fix crash when closing/reopening tabs 2016-08-01 17:25:55 +02:00
Florian Bruhin
5ec39b7540 Fix crash when opening http://foo%40bar@baz 2016-08-01 17:18:14 +02:00
Florian Bruhin
4414f5fea9 Merge branch 'tab-move-index' of https://github.com/mlochbaum/qutebrowser into mlochbaum-tab-move-index 2016-08-01 16:17:09 +02:00
Florian Bruhin
86669600ff Consider input elements without type for hinting 2016-08-01 15:49:50 +02:00
Florian Bruhin
13269ef388 Wrap long lines 2016-08-01 12:46:47 +02:00
Florian Bruhin
a772e8a2c3 Mark :set-mark/:jump-mark as hidden
Fixes #1708.
2016-08-01 12:21:18 +02:00
Marshall Lochbaum
a7438f4f15 Extend tab-move's direction argument to take an index (fixes #1701) 2016-07-29 23:06:51 -04:00
Florian Bruhin
066c9bf4dc Split websettings into web{kit,engine,}settings 2016-07-29 12:01:22 +02:00
Florian Bruhin
08a9786a73 Add a stub for WebEnginePage.createWindow
See #1699.
2016-07-29 10:35:14 +02:00
Florian Bruhin
af704439d9 Remove trailing newline 2016-07-29 09:05:25 +02:00
Claire Cavanaugh
3d258df23a Heil PEP8 :P 2016-07-28 23:24:34 -07:00
Claire Cavanaugh
bf44636a24 :open opens quickmark when given a quckmark name 2016-07-28 22:50:10 -07:00
Florian Bruhin
b48b7eddc8 Add no-cover pragma for _rect_on_view_js 2016-07-28 17:33:04 +02:00
Florian Bruhin
56515321dd Handle failing javascript in webelem.rect_on_view
Fixes #1641.
2016-07-28 17:10:31 +02:00
Florian Bruhin
5463e133ee Split webelem.rect_for_view into two methods 2016-07-28 17:09:07 +02:00
Florian Bruhin
d6b6afdf11 Fix WebElementWrapper.__eq__ 2016-07-28 15:57:25 +02:00
Florian Bruhin
1213b91b66 Fix ALL the contentsSizeChanged connections! 2016-07-28 15:29:56 +02:00
Florian Bruhin
9cbf9eaa76 Disconnect contents_size_changed during cleanup 2016-07-28 14:59:23 +02:00
Florian Bruhin
21c1dec59a Actually handle contents_size_changed correctly 2016-07-28 14:56:42 +02:00
Florian Bruhin
d357ccf403 Add some more WebElementWrapper tests 2016-07-28 14:25:53 +02:00
Florian Bruhin
b0a0984fe7 Add missing check_vanished in remove_blank_target 2016-07-28 13:13:21 +02:00
Florian Bruhin
41e6a2392a QtWebEngine: Add stub for find_all_elements 2016-07-28 12:36:09 +02:00
Florian Bruhin
631109e5eb Fix raising of WebTabError 2016-07-28 12:36:09 +02:00
Florian Bruhin
d87840e254 Fix lint 2016-07-28 12:36:09 +02:00
Florian Bruhin
540c62c232 Add only_visible to find_all_elements 2016-07-28 12:36:09 +02:00
Florian Bruhin
5b943a431e Fix WebElementWrapper.text 2016-07-28 12:36:09 +02:00
Florian Bruhin
49f57a5d7e Fix userscripts 2016-07-28 12:36:09 +02:00
Florian Bruhin
5eca6e11a5 Fix editor/paste-primary 2016-07-28 12:36:09 +02:00
Florian Bruhin
e051de4843 Fix word hinting 2016-07-28 12:36:09 +02:00
Florian Bruhin
ffdaf8d470 Move webelem.is_visible/.rect_on_view to methods 2016-07-28 12:36:09 +02:00
Florian Bruhin
4318604c57 Don't use javascript in webelem.set_text for hints 2016-07-28 12:36:09 +02:00
Florian Bruhin
193c755637 Refactor WebElement API, part 2
Now we don't get a crash, but not any hints either...
2016-07-28 12:35:59 +02:00
Florian Bruhin
c5a91004f5 Add contents_size_changed to tab API 2016-07-28 12:35:56 +02:00
Florian Bruhin
c764733472 Refactor QWebElement API, part 1 2016-07-28 12:35:49 +02:00
Florian Bruhin
016c13a998 Use repr() for rfc2622 logging 2016-07-28 07:28:21 +02:00