Merge pull request #4408 from lyeoh/master

Strip fragment and query only for `:navigate up`
This commit is contained in:
Jay Kamat 2018-11-12 21:12:53 -08:00 committed by GitHub
commit 6010ce69b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View File

@ -65,6 +65,7 @@ Fixed
`content.cookies.accept = no-3rdparty` from working properly on some pages
like GMail. However, the default for `content.cookies.accept` is still `all`
to be in line with what other browsers do.
- `:navigate` not incrementing in anchors or queries or anchors.
v1.5.2
------

View File

@ -636,7 +636,6 @@ class CommandDispatcher:
cmdutils.check_exclusive((tab, bg, window), 'tbw')
widget = self._current_widget()
url = self._current_url()
url = url.adjusted(QUrl.RemoveFragment | QUrl.RemoveQuery)
handlers = {
'prev': functools.partial(navigate.prevnext, prev=True),
@ -654,6 +653,8 @@ class CommandDispatcher:
handler(browsertab=widget, win_id=self._win_id, baseurl=url,
tab=tab, background=bg, window=window)
elif where in ['up', 'increment', 'decrement']:
if where == 'up':
url = url.adjusted(QUrl.RemoveFragment | QUrl.RemoveQuery)
new_url = handlers[where](url, count)
self._open(new_url, tab, bg, window, related=True)
else: # pragma: no cover

View File

@ -125,6 +125,12 @@ Feature: Using :navigate
And I run :navigate increment
Then the error "No number found in URL!" should be shown
Scenario: Incrementing query
When I set url.incdec_segments to ["query"]
And I open data/numbers/1.txt?value=2
And I run :navigate increment
Then data/numbers/1.txt?value=3 should be loaded
@qtwebengine_todo: Doesn't find any elements
Scenario: Navigating multiline links
When I open data/navigate/multilinelinks.html