From 398b1a4b398324311b6e0f15d2e4ede5ad8500ff Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 2 May 2025 12:04:43 +0530 Subject: Prefix uv with web.uv + add permissions_persistance config option --- src/LuaRuntime.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/LuaRuntime.cpp') diff --git a/src/LuaRuntime.cpp b/src/LuaRuntime.cpp index 07ddb67..e9dc86f 100644 --- a/src/LuaRuntime.cpp +++ b/src/LuaRuntime.cpp @@ -35,7 +35,8 @@ void LuaRuntime::start_event_loop() { luv_set_loop(state, event_loop->get_uv_loop()); luv_set_callback(state, &luv_callback); luaopen_luv(state); - lua_setglobal(state, uv_global_name); + lua_setglobal(state, "uv"); + luaL_dostring(state, "web.uv = uv"); } void LuaRuntime::stop_event_loop() { @@ -46,13 +47,13 @@ void LuaRuntime::stop_event_loop() { // Clear the uv global lua_pushnil(state); - lua_setglobal(state, uv_global_name); + lua_setglobal(state, "uv"); lua_gc(state, LUA_GCCOLLECT, 0); } void LuaRuntime::init_web_api() { luaL_newlib(state, internals_api); - lua_setglobal(state, internals_global_name); + lua_setglobal(state, "__internals"); require_module("null-browser.api"); } -- cgit v1.3.1