aboutsummaryrefslogtreecommitdiff
path: root/src/LuaRuntimeApi.hpp
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-08-02 22:19:24 +0530
committerAkshay Nair <phenax5@gmail.com>2025-08-02 22:19:24 +0530
commit0d1258aee3f39c8d5348588a87e804ec8cd27bd5 (patch)
tree60b0c15a9f61ab825a1e1d9c6f8388b0aaf03d7c /src/LuaRuntimeApi.hpp
parentd37020870600d6c842f9a75ebd3986df6010c25c (diff)
downloadnull-browser-0d1258aee3f39c8d5348588a87e804ec8cd27bd5.tar.gz
null-browser-0d1258aee3f39c8d5348588a87e804ec8cd27bd5.zip
Add web.view.reload
Diffstat (limited to '')
-rw-r--r--src/LuaRuntimeApi.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/LuaRuntimeApi.hpp b/src/LuaRuntimeApi.hpp
index 28ffd5f..0af1e9e 100644
--- a/src/LuaRuntimeApi.hpp
+++ b/src/LuaRuntimeApi.hpp
@@ -339,6 +339,14 @@ int lua_api_decorations_get_view(lua_State *state) {
return 1;
}
+int lua_api_view_reload(lua_State *state) {
+ WebViewId webview_id = lua_isnoneornil(state, 1) ? 0 : lua_tointeger(state, 1);
+ auto &runtime = LuaRuntime::instance();
+ emit runtime.webview_reload_requested(webview_id);
+ lua_pushnil(state);
+ return 1;
+}
+
// :: string -> (table -> nil) -> WebViewId -> nil
int lua_api_view_expose(lua_State *state) {
const char *name = lua_tostring(state, 1);
@@ -390,6 +398,7 @@ static luaL_Reg internals_api[] = {
luaL_Reg{"view_scroll", &lua_api_view_scroll},
luaL_Reg{"view_scroll_to_top", &lua_api_view_scroll_top},
luaL_Reg{"view_scroll_to_bottom", &lua_api_view_scroll_bottom},
+ luaL_Reg{"view_reload", &lua_api_view_reload},
luaL_Reg{"view_expose", &lua_api_view_expose},
luaL_Reg{"history_back", &lua_history_back},
luaL_Reg{"history_forward", &lua_history_forward},