Skip to content

Commit a69164b

Browse files
committed
page: fix page mode when loading about:blank
1 parent 43958b8 commit a69164b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/browser/page.zig

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,11 +549,16 @@ pub const Page = struct {
549549
.body = opts.body != null,
550550
});
551551

552-
// if the url is about:blank, nothing to do.
552+
// if the url is about:blank, we load an empty HTML document in the
553+
// page and dispatch the events.
553554
if (std.mem.eql(u8, "about:blank", request_url)) {
554555
const html_doc = try parser.documentHTMLParseFromStr("");
555556
try self.setDocument(html_doc);
556557

558+
// Assume we parsed the document.
559+
// It's important to force a reset during the following navigation.
560+
self.mode = .parsed;
561+
557562
// We do not processHTMLDoc here as we know we don't have any scripts
558563
// This assumption may be false when CDP Page.addScriptToEvaluateOnNewDocument is implemented
559564
self.documentIsComplete();

0 commit comments

Comments
 (0)