mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 22:53:28 +00:00
page: fix page mode when loading about:blank
This commit is contained in:
@@ -549,11 +549,16 @@ pub const Page = struct {
|
|||||||
.body = opts.body != null,
|
.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)) {
|
if (std.mem.eql(u8, "about:blank", request_url)) {
|
||||||
const html_doc = try parser.documentHTMLParseFromStr("");
|
const html_doc = try parser.documentHTMLParseFromStr("");
|
||||||
try self.setDocument(html_doc);
|
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
|
// 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
|
// This assumption may be false when CDP Page.addScriptToEvaluateOnNewDocument is implemented
|
||||||
self.documentIsComplete();
|
self.documentIsComplete();
|
||||||
|
|||||||
Reference in New Issue
Block a user