From c7e105ee4254d00f591c4c002f32c223f4c2448a Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Mon, 4 Aug 2025 22:36:56 +0530 Subject: Add on_result callback for web.view.run_js --- src/widgets/WebViewStack.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/widgets/WebViewStack.cpp') diff --git a/src/widgets/WebViewStack.cpp b/src/widgets/WebViewStack.cpp index ab5808f..5503a3c 100644 --- a/src/widgets/WebViewStack.cpp +++ b/src/widgets/WebViewStack.cpp @@ -342,14 +342,15 @@ void WebViewStack::set_html(const QString &html, WebViewId webview_id) { webview->setHtml(html); } -void WebViewStack::run_javascript(const QString &js_code, WebViewId webview_id) { +void WebViewStack::run_javascript(const QString &js_code, WebViewId webview_id, + const JsOnResultFunc &on_result) { auto *webview = get_webview(webview_id); if (webview == nullptr) { qDebug() << "Webview does not exist"; return; } - webview->run_javascript(js_code); + webview->run_javascript(js_code, on_result); } void WebViewStack::expose_rpc_function(const QString &name, const RpcFunc & /* unused */, -- cgit v1.3.1