1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:48:10 +00:00

LibWeb: Use FrameLoader::load_html() when loading error pages

Use our existing helper function for parsing a HTML string and opening
it as the main content of the attached browsing context.
This commit is contained in:
Andreas Kling 2022-04-06 14:47:06 +02:00
parent 35934acbd3
commit 0eae88f613

View file

@ -256,9 +256,7 @@ void FrameLoader::load_error_page(const AK::URL& failed_url, String const& error
generator.set("failed_url", escape_html_entities(failed_url.to_string()));
generator.set("error", escape_html_entities(error));
generator.append(data);
auto document = HTML::parse_html_document(generator.as_string_view(), failed_url, "utf-8");
VERIFY(document);
browsing_context().set_active_document(document);
load_html(generator.as_string_view(), failed_url);
},
[](auto& error, auto) {
dbgln("Failed to load error page: {}", error);