mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-17 08:48:58 +00:00
cdp: multiple isolated worlds
This commit is contained in:
@@ -277,10 +277,15 @@ fn resolveNode(cmd: anytype) !void {
|
||||
var js_context = page.main_context;
|
||||
if (params.executionContextId) |context_id| {
|
||||
if (js_context.v8_context.debugContextId() != context_id) {
|
||||
var isolated_world = bc.isolated_world orelse return error.ContextNotFound;
|
||||
js_context = &(isolated_world.executor.js_context orelse return error.ContextNotFound);
|
||||
|
||||
if (js_context.v8_context.debugContextId() != context_id) return error.ContextNotFound;
|
||||
var found = false;
|
||||
for (bc.isolated_worlds.items) |*isolated_world| {
|
||||
js_context = &(isolated_world.executor.js_context orelse return error.ContextNotFound);
|
||||
if (js_context.v8_context.debugContextId() == context_id) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) return error.ContextNotFound;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user