mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-30 15:41:48 +00:00
userctx: inject user context
This commit is contained in:
@@ -28,6 +28,7 @@ const storage = @import("storage/storage.zig");
|
||||
const html_test = @import("html_test.zig").html;
|
||||
|
||||
pub const Types = jsruntime.reflect(apiweb.Interfaces);
|
||||
pub const UserContext = apiweb.UserContext;
|
||||
|
||||
var doc: *parser.DocumentHTML = undefined;
|
||||
|
||||
@@ -39,6 +40,10 @@ fn execJS(
|
||||
try js_env.start(alloc);
|
||||
defer js_env.stop();
|
||||
|
||||
js_env.setUserContext(UserContext{
|
||||
.document = doc,
|
||||
});
|
||||
|
||||
var storageShelf = storage.Shelf.init(alloc);
|
||||
defer storageShelf.deinit();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user