* feat: Register extensions in render process - Add CefExtensions type to hold V8 extension code - Pass extensions through BrowserProcessAppBuilder - Register extensions in RenderProcessHandler on WebKit initialization - Decode JSON extensions from command line switch - Prefix extension names with "v8/" per CEF convention - Include actual JSON in error messages for debugging l * feat: refactor window.cef API and register as CEF extension * fix: remove debug print statements in render process handler * refactor: centralize EXTENSIONS_SWITCH constant in util.rs * fmt * refactor: implement Default trait for CefApiHandler * docs: add documentation for CefApiHandler and its JavaScript API functions --------- Co-authored-by: not-elm <elmgameinfo@gmail.com>
28 lines
710 B
HTML
28 lines
710 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>JS Emit</title>
|
|
</head>
|
|
<body style=" color: white">
|
|
<h1>HTML Path: assets/js_emit.html</h1>
|
|
|
|
<p>The example sends events from JavaScript to the application.</p>
|
|
<p>
|
|
It emits a count value every second, which is then sent to the application and logged in the console.
|
|
</p>
|
|
<h1 id="count" style="color: aqua">0</h1>
|
|
<script>
|
|
const countElement = document.getElementById("count");
|
|
let count = 0;
|
|
window.setInterval(() => {
|
|
console.log("Emitting count:", count);
|
|
cef.emit({
|
|
count,
|
|
});
|
|
countElement.innerText = count;
|
|
count += 1;
|
|
}, 1000)
|
|
</script>
|
|
</body>
|
|
</html> |