parent
580648da32
commit
7c08444c37
@ -62,6 +62,7 @@ Fixed
|
|||||||
- When downloading files with QtWebKit, a User-Agent header is set when possible.
|
- When downloading files with QtWebKit, a User-Agent header is set when possible.
|
||||||
- Fixed showing of keybindings in the :help completion
|
- Fixed showing of keybindings in the :help completion
|
||||||
- Worked around a segfault when opening a URL after a QtWebEngine renderer process crash
|
- Worked around a segfault when opening a URL after a QtWebEngine renderer process crash
|
||||||
|
- Using :undo or :tab-clone with a view-source:// or chrome:// tab is now prevented, as it segfaults
|
||||||
|
|
||||||
v0.9.1
|
v0.9.1
|
||||||
------
|
------
|
||||||
|
@ -427,6 +427,11 @@ class CommandDispatcher:
|
|||||||
cmdutils.check_exclusive((bg, window), 'bw')
|
cmdutils.check_exclusive((bg, window), 'bw')
|
||||||
curtab = self._current_widget()
|
curtab = self._current_widget()
|
||||||
cur_title = self._tabbed_browser.page_title(self._current_index())
|
cur_title = self._tabbed_browser.page_title(self._current_index())
|
||||||
|
try:
|
||||||
|
history = curtab.history.serialize()
|
||||||
|
except browsertab.WebTabError as e:
|
||||||
|
raise cmdexc.CommandError(e)
|
||||||
|
|
||||||
# The new tab could be in a new tabbed_browser (e.g. because of
|
# The new tab could be in a new tabbed_browser (e.g. because of
|
||||||
# tabs-are-windows being set)
|
# tabs-are-windows being set)
|
||||||
if window:
|
if window:
|
||||||
@ -437,13 +442,15 @@ class CommandDispatcher:
|
|||||||
new_tabbed_browser = objreg.get('tabbed-browser', scope='window',
|
new_tabbed_browser = objreg.get('tabbed-browser', scope='window',
|
||||||
window=newtab.win_id)
|
window=newtab.win_id)
|
||||||
idx = new_tabbed_browser.indexOf(newtab)
|
idx = new_tabbed_browser.indexOf(newtab)
|
||||||
|
|
||||||
new_tabbed_browser.set_page_title(idx, cur_title)
|
new_tabbed_browser.set_page_title(idx, cur_title)
|
||||||
if config.get('tabs', 'show-favicons'):
|
if config.get('tabs', 'show-favicons'):
|
||||||
new_tabbed_browser.setTabIcon(idx, curtab.icon())
|
new_tabbed_browser.setTabIcon(idx, curtab.icon())
|
||||||
if config.get('tabs', 'tabs-are-windows'):
|
if config.get('tabs', 'tabs-are-windows'):
|
||||||
new_tabbed_browser.window().setWindowIcon(curtab.icon())
|
new_tabbed_browser.window().setWindowIcon(curtab.icon())
|
||||||
|
|
||||||
newtab.data.keep_icon = True
|
newtab.data.keep_icon = True
|
||||||
newtab.history.deserialize(curtab.history.serialize())
|
newtab.history.deserialize(history)
|
||||||
newtab.zoom.set_factor(curtab.zoom.factor())
|
newtab.zoom.set_factor(curtab.zoom.factor())
|
||||||
return newtab
|
return newtab
|
||||||
|
|
||||||
|
@ -384,6 +384,11 @@ class WebEngineHistory(browsertab.AbstractHistory):
|
|||||||
return self._history.canGoForward()
|
return self._history.canGoForward()
|
||||||
|
|
||||||
def serialize(self):
|
def serialize(self):
|
||||||
|
# WORKAROUND for https://github.com/qutebrowser/qutebrowser/issues/2289
|
||||||
|
# FIXME:qtwebengine can we get rid of this with Qt 5.8.1?
|
||||||
|
scheme = self._history.currentItem().url().scheme()
|
||||||
|
if scheme in ['view-source', 'chrome']:
|
||||||
|
raise browsertab.WebTabError("Can't serialize special URL!")
|
||||||
return qtutils.serialize(self._history)
|
return qtutils.serialize(self._history)
|
||||||
|
|
||||||
def deserialize(self, data):
|
def deserialize(self, data):
|
||||||
|
@ -268,9 +268,12 @@ class TabbedBrowser(tabwidget.TabWidget):
|
|||||||
window=self._win_id):
|
window=self._win_id):
|
||||||
objreg.delete('last-focused-tab', scope='window',
|
objreg.delete('last-focused-tab', scope='window',
|
||||||
window=self._win_id)
|
window=self._win_id)
|
||||||
if tab.url().isValid():
|
if tab.url().isValid() and add_undo:
|
||||||
history_data = tab.history.serialize()
|
try:
|
||||||
if add_undo:
|
history_data = tab.history.serialize()
|
||||||
|
except browsertab.WebTabError:
|
||||||
|
pass # special URL
|
||||||
|
else:
|
||||||
entry = UndoEntry(tab.url(), history_data, idx)
|
entry = UndoEntry(tab.url(), history_data, idx)
|
||||||
self._undo_stack.append(entry)
|
self._undo_stack.append(entry)
|
||||||
elif tab.url().isEmpty():
|
elif tab.url().isEmpty():
|
||||||
|
@ -604,6 +604,12 @@ Feature: Tab management
|
|||||||
- url: http://localhost:*/data/title.html
|
- url: http://localhost:*/data/title.html
|
||||||
title: Test title
|
title: Test title
|
||||||
|
|
||||||
|
# https://github.com/qutebrowser/qutebrowser/issues/2289
|
||||||
|
Scenario: Cloning a tab with a special URL
|
||||||
|
When I open chrome://gpu
|
||||||
|
And I run :tab-clone
|
||||||
|
Then the error "Can't serialize special URL!" should be shown
|
||||||
|
|
||||||
# :tab-detach
|
# :tab-detach
|
||||||
|
|
||||||
Scenario: Detaching a tab
|
Scenario: Detaching a tab
|
||||||
@ -759,6 +765,17 @@ Feature: Tab management
|
|||||||
- data/numbers/2.txt
|
- data/numbers/2.txt
|
||||||
- data/numbers/3.txt
|
- data/numbers/3.txt
|
||||||
|
|
||||||
|
# https://github.com/qutebrowser/qutebrowser/issues/2289
|
||||||
|
Scenario: Undoing a tab with a special URL
|
||||||
|
Given I have a fresh instance
|
||||||
|
When I open data/numbers/1.txt
|
||||||
|
And I open chrome://gpu in a new tab
|
||||||
|
And I run :tab-close
|
||||||
|
And I run :undo
|
||||||
|
Then the error "Nothing to undo!" should be shown
|
||||||
|
And the following tabs should be open:
|
||||||
|
- data/numbers/1.txt (active)
|
||||||
|
|
||||||
# last-close
|
# last-close
|
||||||
|
|
||||||
# FIXME:qtwebengine
|
# FIXME:qtwebengine
|
||||||
|
Loading…
Reference in New Issue
Block a user