mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
load polyfills on creation
This commit is contained in:
@@ -367,7 +367,7 @@ pub fn BrowserContext(comptime CDP_T: type) type {
|
|||||||
self.node_search_list.reset();
|
self.node_search_list.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn createIsolatedWorld(self: *Self, page: *Page, world_name: []const u8, grant_universal_access: bool) !*IsolatedWorld {
|
pub fn createIsolatedWorld(self: *Self, world_name: []const u8, grant_universal_access: bool) !*IsolatedWorld {
|
||||||
if (self.isolated_world != null) {
|
if (self.isolated_world != null) {
|
||||||
return error.CurrentlyOnly1IsolatedWorldSupported;
|
return error.CurrentlyOnly1IsolatedWorldSupported;
|
||||||
}
|
}
|
||||||
@@ -381,9 +381,7 @@ pub fn BrowserContext(comptime CDP_T: type) type {
|
|||||||
.executor = executor,
|
.executor = executor,
|
||||||
.grant_universal_access = grant_universal_access,
|
.grant_universal_access = grant_universal_access,
|
||||||
};
|
};
|
||||||
const world = &self.isolated_world.?;
|
return &self.isolated_world.?;
|
||||||
try world.createContext(page);
|
|
||||||
return world;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn nodeWriter(self: *Self, node: *const Node, opts: Node.Writer.Opts) Node.Writer {
|
pub fn nodeWriter(self: *Self, node: *const Node, opts: Node.Writer.Opts) Node.Writer {
|
||||||
|
|||||||
@@ -113,8 +113,9 @@ fn createIsolatedWorld(cmd: anytype) !void {
|
|||||||
}
|
}
|
||||||
const bc = cmd.browser_context orelse return error.BrowserContextNotLoaded;
|
const bc = cmd.browser_context orelse return error.BrowserContextNotLoaded;
|
||||||
|
|
||||||
|
const world = try bc.createIsolatedWorld(params.worldName, params.grantUniveralAccess);
|
||||||
const page = bc.session.currentPage().?;
|
const page = bc.session.currentPage().?;
|
||||||
const world = try bc.createIsolatedWorld(page, params.worldName, params.grantUniveralAccess);
|
try pageCreated(bc, page);
|
||||||
const scope = world.scope.?;
|
const scope = world.scope.?;
|
||||||
|
|
||||||
// Create the auxdata json for the contextCreated event
|
// Create the auxdata json for the contextCreated event
|
||||||
|
|||||||
Reference in New Issue
Block a user