mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-30 15:41:48 +00:00
No need to navigate to about:blank
This commit is contained in:
@@ -125,9 +125,6 @@ fn createTarget(cmd: anytype) !void {
|
||||
bc.target_id = target_id;
|
||||
|
||||
var page = try bc.session.createPage();
|
||||
// Navigate to about:blank such that the window.document are created and set
|
||||
const url = @import("../../url.zig").URL.about_blank;
|
||||
try page.navigate(url, .{});
|
||||
{
|
||||
const aux_data = try std.fmt.allocPrint(cmd.arena, "{{\"isDefault\":true,\"type\":\"default\",\"frameId\":\"{s}\"}}", .{target_id});
|
||||
bc.inspector.contextCreated(
|
||||
@@ -504,10 +501,6 @@ test "cdp.target: createTarget" {
|
||||
// should create a browser context
|
||||
const bc = ctx.cdp().browser_context.?;
|
||||
try ctx.expectSentEvent("Target.targetCreated", .{ .targetInfo = .{ .url = "about:blank", .title = "about:blank", .attached = false, .type = "page", .canAccessOpener = false, .browserContextId = bc.id, .targetId = bc.target_id.? } }, .{});
|
||||
|
||||
// Even about:blank should set the window.document
|
||||
const page = ctx.cdp().browser_context.?.session.page.?;
|
||||
try testing.expect(page.window.document != null);
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user