Skip to content

Commit 80ee64c

Browse files
committed
load polyfills on creation
1 parent 8c37d56 commit 80ee64c

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/cdp/cdp.zig

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ pub fn BrowserContext(comptime CDP_T: type) type {
367367
self.node_search_list.reset();
368368
}
369369

370-
pub fn createIsolatedWorld(self: *Self, page: *Page, world_name: []const u8, grant_universal_access: bool) !*IsolatedWorld {
370+
pub fn createIsolatedWorld(self: *Self, world_name: []const u8, grant_universal_access: bool) !*IsolatedWorld {
371371
if (self.isolated_world != null) {
372372
return error.CurrentlyOnly1IsolatedWorldSupported;
373373
}
@@ -381,9 +381,7 @@ pub fn BrowserContext(comptime CDP_T: type) type {
381381
.executor = executor,
382382
.grant_universal_access = grant_universal_access,
383383
};
384-
const world = &self.isolated_world.?;
385-
try world.createContext(page);
386-
return world;
384+
return &self.isolated_world.?;
387385
}
388386

389387
pub fn nodeWriter(self: *Self, node: *const Node, opts: Node.Writer.Opts) Node.Writer {

src/cdp/domains/page.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,9 @@ fn createIsolatedWorld(cmd: anytype) !void {
113113
}
114114
const bc = cmd.browser_context orelse return error.BrowserContextNotLoaded;
115115

116+
const world = try bc.createIsolatedWorld(params.worldName, params.grantUniveralAccess);
116117
const page = bc.session.currentPage().?;
117-
const world = try bc.createIsolatedWorld(page, params.worldName, params.grantUniveralAccess);
118+
try pageCreated(bc, page);
118119
const scope = world.scope.?;
119120

120121
// Create the auxdata json for the contextCreated event

0 commit comments

Comments
 (0)