1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:47:35 +00:00

BrowserSettings+Ladybird: Convert home / new tab page to resource URIs

This commit is contained in:
Timothy Flynn 2023-11-05 09:35:20 -05:00 committed by Andreas Kling
parent 1b30b510b9
commit 818471b7a7
6 changed files with 33 additions and 45 deletions

View file

@ -24,22 +24,6 @@
# error "This project requires ARC"
#endif
static URL rebase_url_on_serenity_resource_root(StringView url_string)
{
URL url { url_string };
Vector<DeprecatedString> paths;
for (auto segment : s_serenity_resource_root.split('/'))
paths.append(move(segment));
for (size_t i = 0; i < url.path_segment_count(); ++i)
paths.append(url.path_segment_at_index(i));
url.set_paths(move(paths));
return url;
}
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
[Application sharedApplication];
@ -66,7 +50,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto database = TRY(WebView::Database::create(move(sql_server_paths)));
auto cookie_jar = TRY(WebView::CookieJar::create(*database));
auto new_tab_page_url = rebase_url_on_serenity_resource_root(Browser::default_new_tab_url);
URL new_tab_page_url = Browser::default_new_tab_url();
Vector<URL> initial_urls;
for (auto const& raw_url : raw_urls) {