Added the possibility to open a selected link in a new tab.
This commit is contained in:
parent
6ca541d359
commit
a56a14fb70
@ -986,9 +986,15 @@ class CommandDispatcher:
|
||||
self._open(url, tab, bg, window)
|
||||
|
||||
@cmdutils.register(instance='command-dispatcher', name='select-follow', scope='window')
|
||||
def select_follow(self):
|
||||
"""Follow the selected text."""
|
||||
def select_follow(self, tab=False):
|
||||
"""Follow the selected text.
|
||||
|
||||
Args:
|
||||
tab: Load the selected link in a new tab.
|
||||
"""
|
||||
widget = self._current_widget()
|
||||
if tab:
|
||||
widget.page().open_target = usertypes.ClickTarget.tab
|
||||
widget.page().currentFrame().evaluateJavaScript('window.getSelection().anchorNode.parentNode.click()')
|
||||
|
||||
@cmdutils.register(instance='command-dispatcher', name='inspector',
|
||||
|
@ -1239,7 +1239,8 @@ KEY_DATA = collections.OrderedDict([
|
||||
('stop', ['<Ctrl-s>']),
|
||||
('print', ['<Ctrl-Alt-p>']),
|
||||
('open qute:settings', ['Ss']),
|
||||
('select-follow', ['<Return>', '<Ctrl-Return>']),
|
||||
('select-follow', ['<Return>']),
|
||||
('select-follow -t', ['<Ctrl-Return>']),
|
||||
])),
|
||||
|
||||
('insert', collections.OrderedDict([
|
||||
|
Loading…
Reference in New Issue
Block a user