diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-07-26 16:59:35 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-07-26 16:59:35 +0530 |
| commit | b0f598910f1f8bc8db6b65a0f01b1950ed7c3841 (patch) | |
| tree | 234758ed1c91238b9498fdc6dd4bcccc42bddc36 /src/WindowActionRouter.cpp | |
| parent | 8ab1f8d796d8f35a65e38fdd03d51824a41d1dab (diff) | |
| download | null-browser-b0f598910f1f8bc8db6b65a0f01b1950ed7c3841.tar.gz null-browser-b0f598910f1f8bc8db6b65a0f01b1950ed7c3841.zip | |
Add web.view.expose for simple lua->js interop in decorations
Diffstat (limited to 'src/WindowActionRouter.cpp')
| -rw-r--r-- | src/WindowActionRouter.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/WindowActionRouter.cpp b/src/WindowActionRouter.cpp index 99d9931..3aeabc7 100644 --- a/src/WindowActionRouter.cpp +++ b/src/WindowActionRouter.cpp @@ -6,7 +6,6 @@ #include "LuaRuntime.hpp" #include "keymap/KeymapEvaluator.hpp" #include "widgets/BrowserWindow.hpp" -#include "widgets/WebViewStack.hpp" #include "WindowActionRouter.hpp" @@ -59,7 +58,7 @@ void WindowActionRouter::initialize(Configuration *config) { WITH_WEBVIEW_WINDOW(webview_id, window, { window->open_url(url, open_type, webview_id); }); }); - connect(&runtime, &LuaRuntime::set_view_html, this, + connect(&runtime, &LuaRuntime::webview_html_set_requested, this, [this](const QString &html, WebViewId webview_id) { WITH_WEBVIEW_WINDOW(webview_id, window, { window->set_html(html, webview_id); }); }); @@ -69,6 +68,11 @@ void WindowActionRouter::initialize(Configuration *config) { connect(&runtime, &LuaRuntime::webview_selected, this, [this](WebViewId webview_id) { WITH_WEBVIEW_WINDOW(webview_id, window, { window->select_webview(webview_id); }); }); + connect(&runtime, &LuaRuntime::webview_rpc_action_defined, this, + [this](const QString &name, const RpcFunc &action, WebViewId webview_id) { + WITH_WEBVIEW_WINDOW(webview_id, window, + { window->expose_rpc_function(name, action, webview_id); }); + }); // Search connect(&runtime, &LuaRuntime::search_requested, this, |
