mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
LibWeb: Allow configuring the default error page path
This commit is contained in:
parent
26bb95425d
commit
bf6c4835e6
Notes:
sideshowbarker
2024-07-17 10:35:15 +09:00
Author: https://github.com/Dexesttp Commit: https://github.com/SerenityOS/serenity/commit/bf6c4835e6 Pull-request: https://github.com/SerenityOS/serenity/pull/13473 Issue: https://github.com/SerenityOS/serenity/issues/10968 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/kleinesfilmroellchen Reviewed-by: https://github.com/krkk Reviewed-by: https://github.com/linusg ✅
2 changed files with 9 additions and 2 deletions
|
@ -259,14 +259,20 @@ void FrameLoader::load_html(StringView html, const AK::URL& url)
|
|||
browsing_context().set_active_document(&parser->document());
|
||||
}
|
||||
|
||||
static String s_error_page_url = "file:///res/html/error.html";
|
||||
|
||||
void FrameLoader::set_error_page_url(String error_page_url)
|
||||
{
|
||||
s_error_page_url = error_page_url;
|
||||
}
|
||||
|
||||
// FIXME: Use an actual templating engine (our own one when it's built, preferably
|
||||
// with a way to check these usages at compile time)
|
||||
|
||||
void FrameLoader::load_error_page(const AK::URL& failed_url, String const& error)
|
||||
{
|
||||
auto error_page_url = "file:///res/html/error.html";
|
||||
ResourceLoader::the().load(
|
||||
error_page_url,
|
||||
s_error_page_url,
|
||||
[this, failed_url, error](auto data, auto&, auto) {
|
||||
VERIFY(!data.is_null());
|
||||
StringBuilder builder;
|
||||
|
|
|
@ -24,6 +24,7 @@ public:
|
|||
};
|
||||
|
||||
static void set_default_favicon_path(String);
|
||||
static void set_error_page_url(String);
|
||||
|
||||
explicit FrameLoader(HTML::BrowsingContext&);
|
||||
~FrameLoader();
|
||||
|
|
Loading…
Reference in a new issue