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();