Emulate webkit duplicate search behavior on webengine
This commit is contained in:
parent
ada15510a7
commit
f926e7b850
@ -1778,10 +1778,10 @@ class CommandDispatcher:
|
||||
"""
|
||||
self.set_mark("'")
|
||||
tab = self._current_widget()
|
||||
if tab.search.search_displayed:
|
||||
tab.search.clear()
|
||||
|
||||
if not text:
|
||||
if tab.search.search_displayed:
|
||||
tab.search.clear()
|
||||
return
|
||||
|
||||
options = {
|
||||
|
@ -183,6 +183,11 @@ class WebEngineSearch(browsertab.AbstractSearch):
|
||||
|
||||
def search(self, text, *, ignore_case='never', reverse=False,
|
||||
result_cb=None):
|
||||
# When duplicate searching, don't search again (webkit behavior)
|
||||
if self.text == text and self.search_displayed:
|
||||
log.webview.debug("Ignoring duplicate search request")
|
||||
return
|
||||
|
||||
self.text = text
|
||||
self._flags = QWebEnginePage.FindFlags(0)
|
||||
if self._is_case_sensitive(ignore_case):
|
||||
|
Loading…
Reference in New Issue
Block a user