From 0e95e99e72237058465959d55b77750a9d7c1bef Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sat, 19 Apr 2025 17:56:03 +0530 Subject: Add web.search and search text implemnetation --- src/WindowActionRouter.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/WindowActionRouter.cpp') diff --git a/src/WindowActionRouter.cpp b/src/WindowActionRouter.cpp index d0b529b..5f787c0 100644 --- a/src/WindowActionRouter.cpp +++ b/src/WindowActionRouter.cpp @@ -58,6 +58,23 @@ void WindowActionRouter::initialize(Configuration *config) { WITH_WEBVIEW_WINDOW(webview_id, window, { emit window->mediator()->webview_selected(webview_id); }); }); + connect(&runtime, &LuaRuntime::search_requested, this, + [this](const QString &text, WebViewId webview_id) { + WITH_WEBVIEW_WINDOW(webview_id, window, { + this->current_search_text = text; + win_match.second->mediator()->set_search_text(text, webview_id, true); + }) + }); + connect(&runtime, &LuaRuntime::search_next_requested, this, [this](WebViewId webview_id) { + WITH_WEBVIEW_WINDOW(webview_id, window, { + win_match.second->mediator()->set_search_text(this->current_search_text, webview_id, true); + }) + }); + connect(&runtime, &LuaRuntime::search_previous_requested, this, [this](WebViewId webview_id) { + WITH_WEBVIEW_WINDOW(webview_id, window, { + win_match.second->mediator()->set_search_text(this->current_search_text, webview_id, false); + }) + }); } void WindowActionRouter::add_window(BrowserWindow *window) { -- cgit v1.3.1