aboutsummaryrefslogtreecommitdiff
path: root/src/widgets/EdgeDecoration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/EdgeDecoration.cpp')
-rw-r--r--src/widgets/EdgeDecoration.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/widgets/EdgeDecoration.cpp b/src/widgets/EdgeDecoration.cpp
index 5277e6c..ed48857 100644
--- a/src/widgets/EdgeDecoration.cpp
+++ b/src/widgets/EdgeDecoration.cpp
@@ -66,9 +66,9 @@ void EdgeDecoration::setup_webview() {
webview = new WebView(WebViewStack::next_webview_id++, profile, this);
layout()->addWidget(webview.value());
webview.value()->enable_rpc_api();
- webview.value()->expose_rpc_function("tab_select", [](RpcArgs args) {
- LuaRuntime::instance().webview_selected(args.at("view").toInt());
- });
+ // expose_rpc_function("tab_select", [](RpcArgs args) {
+ // LuaRuntime::instance().webview_selected(args.at("view").toInt());
+ // });
}
webview.value()->setHtml(QString(default_html_layout).replace("{{body}}", html_content),
@@ -95,3 +95,9 @@ void EdgeDecoration::set_url(const QUrl &url) {
std::optional<WebViewId> EdgeDecoration::get_view_id() {
return webview.has_value() ? std::make_optional(webview.value()->get_id()) : std::nullopt;
}
+
+void EdgeDecoration::expose_rpc_function(const QString &name, const RpcFunc &action) {
+ if (!webview.has_value())
+ return;
+ webview.value()->expose_rpc_function(name, action);
+}