dirty initial port of chrome caretbrowser extension
This commit is contained in:
parent
3a012ca1e3
commit
b184d2f94d
@ -179,7 +179,8 @@ class WebEngineCaret(browsertab.AbstractCaret):
|
|||||||
|
|
||||||
@pyqtSlot(usertypes.KeyMode)
|
@pyqtSlot(usertypes.KeyMode)
|
||||||
def _on_mode_entered(self, mode):
|
def _on_mode_entered(self, mode):
|
||||||
pass
|
js_code = javascript.assemble('caret', 'setInitialCursor')
|
||||||
|
self._tab.run_js_async(js_code)
|
||||||
|
|
||||||
@pyqtSlot(usertypes.KeyMode)
|
@pyqtSlot(usertypes.KeyMode)
|
||||||
def _on_mode_left(self):
|
def _on_mode_left(self):
|
||||||
@ -547,6 +548,8 @@ class WebEngineTab(browsertab.AbstractTab):
|
|||||||
'window._qutebrowser = {};',
|
'window._qutebrowser = {};',
|
||||||
utils.read_file('javascript/scroll.js'),
|
utils.read_file('javascript/scroll.js'),
|
||||||
utils.read_file('javascript/webelem.js'),
|
utils.read_file('javascript/webelem.js'),
|
||||||
|
utils.read_file('javascript/webengine_caret.js'),
|
||||||
|
utils.read_file('javascript/axs_testing.js'),
|
||||||
])
|
])
|
||||||
script = QWebEngineScript()
|
script = QWebEngineScript()
|
||||||
script.setInjectionPoint(QWebEngineScript.DocumentCreation)
|
script.setInjectionPoint(QWebEngineScript.DocumentCreation)
|
||||||
|
2643
qutebrowser/javascript/axs_testing.js
Normal file
2643
qutebrowser/javascript/axs_testing.js
Normal file
File diff suppressed because it is too large
Load Diff
2188
qutebrowser/javascript/webengine_caret.js
Normal file
2188
qutebrowser/javascript/webengine_caret.js
Normal file
File diff suppressed because it is too large
Load Diff
@ -267,10 +267,6 @@ class ModeManager(QObject):
|
|||||||
usertypes.KeyMode.yesno, usertypes.KeyMode.prompt]:
|
usertypes.KeyMode.yesno, usertypes.KeyMode.prompt]:
|
||||||
raise cmdexc.CommandError(
|
raise cmdexc.CommandError(
|
||||||
"Mode {} can't be entered manually!".format(mode))
|
"Mode {} can't be entered manually!".format(mode))
|
||||||
elif (m == usertypes.KeyMode.caret and
|
|
||||||
objects.backend == usertypes.Backend.QtWebEngine):
|
|
||||||
raise cmdexc.CommandError("Caret mode is not supported with "
|
|
||||||
"QtWebEngine yet.")
|
|
||||||
|
|
||||||
self.enter(m, 'command')
|
self.enter(m, 'command')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user