RuneStone 1.0.0

This commit is contained in:
Knotty Wyvern
2026-11-03 00:23:07 -07:00
commit 5557443ed1
818 changed files with 239368 additions and 0 deletions
@@ -0,0 +1,12 @@
const sessions = new WeakMap();
export async function nativeRequest(page, command, args = {}) {
const invoke = (name, value) => page.evaluate(({ name, value }) => window.__TAURI_INTERNALS__.invoke(name, value), { name, value });
if (command === 'browser_request') {
let session = sessions.get(page);
if (!session) { session = await invoke('browser_connect', {}); sessions.set(page, session); }
return invoke(command, { ...args, session });
}
if (command === 'browser_stop') sessions.delete(page);
return invoke(command, args);
}