mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-18 01:48:10 +00:00
add native custom elements
This commit is contained in:
@@ -644,7 +644,6 @@ pub fn BrowserContext(comptime CDP_T: type) type {
|
||||
|
||||
// debugger events
|
||||
|
||||
|
||||
pub fn onRunMessageLoopOnPause(_: *anyopaque, _: u32) void {
|
||||
// onRunMessageLoopOnPause is called when a breakpoint is hit.
|
||||
// Until quit pause, we must continue to run a nested message loop
|
||||
@@ -743,12 +742,9 @@ const IsolatedWorld = struct {
|
||||
);
|
||||
}
|
||||
|
||||
pub fn createContextAndLoadPolyfills(self: *IsolatedWorld, arena: Allocator, page: *Page) !void {
|
||||
pub fn createContextAndLoadPolyfills(self: *IsolatedWorld, page: *Page) !void {
|
||||
// We need to recreate the isolated world context
|
||||
try self.createContext(page);
|
||||
|
||||
const loader = @import("../browser/polyfill/polyfill.zig");
|
||||
try loader.preload(arena, &self.executor.context.?);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ fn createIsolatedWorld(cmd: anytype) !void {
|
||||
|
||||
const world = try bc.createIsolatedWorld(params.worldName, params.grantUniveralAccess);
|
||||
const page = bc.session.currentPage() orelse return error.PageNotLoaded;
|
||||
try world.createContextAndLoadPolyfills(bc.arena, page);
|
||||
try world.createContextAndLoadPolyfills(page);
|
||||
const js_context = &world.executor.context.?;
|
||||
|
||||
// Create the auxdata json for the contextCreated event
|
||||
@@ -281,7 +281,7 @@ pub fn pageRemove(bc: anytype) !void {
|
||||
|
||||
pub fn pageCreated(bc: anytype, page: *Page) !void {
|
||||
for (bc.isolated_worlds.items) |*isolated_world| {
|
||||
try isolated_world.createContextAndLoadPolyfills(bc.arena, page);
|
||||
try isolated_world.createContextAndLoadPolyfills(page);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user