From a69164b48294df6843f311a5725f0dcc86304cb8 Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Wed, 22 Oct 2025 12:08:27 +0200 Subject: [PATCH] page: fix page mode when loading about:blank --- src/browser/page.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/browser/page.zig b/src/browser/page.zig index 5bfd6374..93361a33 100644 --- a/src/browser/page.zig +++ b/src/browser/page.zig @@ -549,11 +549,16 @@ pub const Page = struct { .body = opts.body != null, }); - // if the url is about:blank, nothing to do. + // if the url is about:blank, we load an empty HTML document in the + // page and dispatch the events. if (std.mem.eql(u8, "about:blank", request_url)) { const html_doc = try parser.documentHTMLParseFromStr(""); try self.setDocument(html_doc); + // Assume we parsed the document. + // It's important to force a reset during the following navigation. + self.mode = .parsed; + // We do not processHTMLDoc here as we know we don't have any scripts // This assumption may be false when CDP Page.addScriptToEvaluateOnNewDocument is implemented self.documentIsComplete();