mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-30 15:41:48 +00:00
share sessionstate and underlying DOM global with the isolated
This commit is contained in:
@@ -122,17 +122,10 @@ fn createTarget(cmd: anytype) !void {
|
||||
|
||||
const target_id = cmd.cdp.target_id_gen.next();
|
||||
|
||||
try bc.createIsolatedWorld();
|
||||
bc.target_id = target_id;
|
||||
|
||||
const page = try bc.session.createPage();
|
||||
|
||||
// The isolate world must share at least some of the state with the related page, specifically the DocumentHTML
|
||||
// (assuming grantUniveralAccess will be set to True!).
|
||||
// We just created the world and the page. The page's state lives in the session, but is update on navigation.
|
||||
// This also means this pointer becomes invalid after removePage untill a new page is created.
|
||||
// Currently we have only 1 page/frame and thus also only 1 state in the isolate world.
|
||||
bc.isolated_world.?.scope.state = &page.state;
|
||||
var page = try bc.session.createPage();
|
||||
try bc.createIsolatedWorld(page);
|
||||
|
||||
{
|
||||
const aux_data = try std.fmt.allocPrint(cmd.arena, "{{\"isDefault\":true,\"type\":\"default\",\"frameId\":\"{s}\"}}", .{target_id});
|
||||
|
||||
Reference in New Issue
Block a user