From 3e2449d1fee8958d28c9308898c15aa1baddfc32 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Tue, 8 Aug 2023 16:05:14 -0400 Subject: [PATCH] Browser+WebDriver: Set the initial URL to about:blank from WebDriver We already do this for headless-browser. There's no need to open any URL other than about:blank when starting a WebDriver session. We should also do this from WebDriver code, rather than in special logic in Browser's main.cpp. --- Ladybird/WebDriver/main.cpp | 1 + Userland/Applications/Browser/main.cpp | 3 --- Userland/Services/WebDriver/main.cpp | 1 + 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Ladybird/WebDriver/main.cpp b/Ladybird/WebDriver/main.cpp index 941bd124893..cd9abf9c3d7 100644 --- a/Ladybird/WebDriver/main.cpp +++ b/Ladybird/WebDriver/main.cpp @@ -36,6 +36,7 @@ static ErrorOr launch_browser(DeprecatedString const& socket_path) Array { "--webdriver-content-path", socket_path.characters(), + "about:blank", }); } diff --git a/Userland/Applications/Browser/main.cpp b/Userland/Applications/Browser/main.cpp index 22d28c20c4e..bf65949d15a 100644 --- a/Userland/Applications/Browser/main.cpp +++ b/Userland/Applications/Browser/main.cpp @@ -114,9 +114,6 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Desktop::Launcher::add_allowed_url(URL::create_with_file_scheme(Core::StandardPaths::downloads_directory()))); TRY(Desktop::Launcher::seal_allowlist()); - if (!Browser::g_webdriver_content_ipc_path.is_empty()) - specified_urls.empend("about:blank"); - TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); TRY(Core::System::unveil("/tmp/session/%sid/portal/image", "rw")); diff --git a/Userland/Services/WebDriver/main.cpp b/Userland/Services/WebDriver/main.cpp index 231efce657f..b954c532279 100644 --- a/Userland/Services/WebDriver/main.cpp +++ b/Userland/Services/WebDriver/main.cpp @@ -20,6 +20,7 @@ static ErrorOr launch_browser(DeprecatedString const& socket_path) Array { "--webdriver-content-path", socket_path.characters(), + "about:blank", }); }