dirty initial port of chrome caretbrowser extension

This commit is contained in:
Artur Shaikhullin 2017-11-16 19:22:08 +06:00
parent 3a012ca1e3
commit b184d2f94d
4 changed files with 4835 additions and 5 deletions

View File

@ -179,7 +179,8 @@ class WebEngineCaret(browsertab.AbstractCaret):
@pyqtSlot(usertypes.KeyMode)
def _on_mode_entered(self, mode):
pass
js_code = javascript.assemble('caret', 'setInitialCursor')
self._tab.run_js_async(js_code)
@pyqtSlot(usertypes.KeyMode)
def _on_mode_left(self):
@ -547,6 +548,8 @@ class WebEngineTab(browsertab.AbstractTab):
'window._qutebrowser = {};',
utils.read_file('javascript/scroll.js'),
utils.read_file('javascript/webelem.js'),
utils.read_file('javascript/webengine_caret.js'),
utils.read_file('javascript/axs_testing.js'),
])
script = QWebEngineScript()
script.setInjectionPoint(QWebEngineScript.DocumentCreation)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -267,10 +267,6 @@ class ModeManager(QObject):
usertypes.KeyMode.yesno, usertypes.KeyMode.prompt]:
raise cmdexc.CommandError(
"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')