aboutsummaryrefslogtreecommitdiff
path: root/src/widgets/WebView.hpp
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-08-04 22:36:56 +0530
committerAkshay Nair <phenax5@gmail.com>2025-08-04 22:36:56 +0530
commitc7e105ee4254d00f591c4c002f32c223f4c2448a (patch)
tree17ebadd5dc1a5e148c4b2f5ed1c70b7c7e54fe1a /src/widgets/WebView.hpp
parent0d1258aee3f39c8d5348588a87e804ec8cd27bd5 (diff)
downloadnull-browser-c7e105ee4254d00f591c4c002f32c223f4c2448a.tar.gz
null-browser-c7e105ee4254d00f591c4c002f32c223f4c2448a.zip
Add on_result callback for web.view.run_js
Diffstat (limited to 'src/widgets/WebView.hpp')
-rw-r--r--src/widgets/WebView.hpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/widgets/WebView.hpp b/src/widgets/WebView.hpp
index 36a252d..0f2bd43 100644
--- a/src/widgets/WebView.hpp
+++ b/src/widgets/WebView.hpp
@@ -20,6 +20,8 @@
using RpcArgs = std::unordered_map<QString, QVariant>;
using RpcFunc = std::function<void(RpcArgs)>;
+using JsOnResultFunc = std::function<void(const std::optional<QVariant> &value)>;
+
class WebView : public QWebEngineView {
Q_OBJECT
@@ -31,6 +33,7 @@ public:
void scroll_to_bottom();
void enable_rpc_api();
void expose_rpc_function(const QString &name, const RpcFunc &action);
+ // void run_javascript(const QString &code, const JsOnResultFunc &on_result);
DELEGATE(page(), runJavaScript, run_javascript)
DEFINE_GETTER(get_id, id)