mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:17:35 +00:00
Ladybird+BrowserSettings: Load the NTP/home resource files with LibWeb
This commit is contained in:
parent
947136ca8d
commit
bacf3cede4
7 changed files with 12 additions and 34 deletions
|
@ -6,38 +6,16 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringView.h>
|
||||
#include <LibCore/Resource.h>
|
||||
|
||||
namespace Browser {
|
||||
|
||||
static constexpr StringView default_homepage_url = "resource://html/misc/welcome.html"sv;
|
||||
static constexpr StringView default_new_tab_url = "resource://ladybird/new-tab.html"sv;
|
||||
static constexpr StringView default_color_scheme = "auto"sv;
|
||||
static constexpr bool default_enable_content_filters = true;
|
||||
static constexpr bool default_show_bookmarks_bar = true;
|
||||
static constexpr bool default_close_download_widget_on_finish = false;
|
||||
static constexpr bool default_allow_autoplay_on_all_websites = false;
|
||||
|
||||
inline String const& default_homepage_url()
|
||||
{
|
||||
// FIXME: Teach LibWeb how to load resource:// URLs, rather than converting to a file:// URL here.
|
||||
static auto default_homepage_url = []() {
|
||||
static constexpr auto url = "resource://html/misc/welcome.html"sv;
|
||||
return MUST(Core::Resource::load_from_uri(url))->file_url();
|
||||
}();
|
||||
|
||||
return default_homepage_url;
|
||||
}
|
||||
|
||||
inline String const& default_new_tab_url()
|
||||
{
|
||||
// FIXME: Teach LibWeb how to load resource:// URLs, rather than converting to a file:// URL here.
|
||||
static auto default_new_tab_url = []() {
|
||||
static constexpr auto url = "resource://ladybird/new-tab.html"sv;
|
||||
return MUST(Core::Resource::load_from_uri(url))->file_url();
|
||||
}();
|
||||
|
||||
return default_new_tab_url;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue