diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-07-27 20:21:07 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-07-27 20:27:42 +0530 |
| commit | 8604765c3660dbea9cae6996d5750bfb985e6751 (patch) | |
| tree | 3a90f68dd07f8eb6a9c92d1f322162ac3b345383 /src/widgets/Decorations.cpp | |
| parent | c95ee83c24b79e64a91a6d3a55addcb6e7ebd11b (diff) | |
| download | null-browser-8604765c3660dbea9cae6996d5750bfb985e6751.tar.gz null-browser-8604765c3660dbea9cae6996d5750bfb985e6751.zip | |
Add web.view.run_js + change rpc js api
Diffstat (limited to 'src/widgets/Decorations.cpp')
| -rw-r--r-- | src/widgets/Decorations.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/widgets/Decorations.cpp b/src/widgets/Decorations.cpp index 7886442..dc644d5 100644 --- a/src/widgets/Decorations.cpp +++ b/src/widgets/Decorations.cpp @@ -84,6 +84,12 @@ void Decorations::set_html(const QString &html, WebViewId view_id) { decoration.value()->set_html(html); } +void Decorations::run_javascript(const QString &js_code, WebViewId view_id) { + auto decoration = get_decoration_widget_by_view_id(view_id); + if (decoration.has_value()) + decoration.value()->run_javascript(js_code); +} + std::optional<WebViewId> Decorations::get_view_id(DecorationType type) { auto decoration = get_decoration_widget_type(type); return decoration.has_value() ? decoration.value()->get_view_id() : std::nullopt; |
