Truly independent web browser
LibWebCommon+LibWebView+WebDriver: Remove the site isolation option
Shannon Booth58932c0cbf0c
diff --git a/Documentation/ProcessArchitecture.md b/Documentation/ProcessArchitecture.mdindex be29afe8d4a..8058adb5f15 100644--- a/Documentation/ProcessArchitecture.md+++ b/Documentation/ProcessArchitecture.md@@ -92,11 +92,7 @@ This process runs the WebRTC connections of a **WebContent** process, outside of## Site isolation-A renderer may be taken over by a page it hosts, so documents of different sites are kept in different processes. The `--site-isolation` option selects how far this goes:--- `iframe`, the default, isolates every document, including cross-site frames.-- `top-level` isolates top-level documents, and frames stay in the process of their parent.-- `disable` keeps every document in the process holding its navigable.+A renderer may be taken over by a page it hosts, so documents of different sites, cross-site frames included, are kept in different processes. The Memory section of `about:settings` chooses whether tabs of one origin or one site share a process. `--debug-process WebContent` turns isolation off, so that every document of a tab stays in the process a debugger is attached to.Documents that can script each other synchronously belong to one agent, and an agent runs in one process. A document with an opaque origin goes with the document that created it. Local file content and WebUI documents are kept in processes of their own, because those processes hold privileges that a website must not get.diff --git a/Libraries/LibWebCommon/CMakeLists.txt b/Libraries/LibWebCommon/CMakeLists.txtindex e09102428e3..a0aa8a27275 100644--- a/Libraries/LibWebCommon/CMakeLists.txt+++ b/Libraries/LibWebCommon/CMakeLists.txt@@ -87,7 +87,6 @@ set(SOURCESWebView/DOMNodeProperties.cppWebView/Geolocation.cppWebView/Mutation.cpp- WebView/SiteIsolation.cppWebView/Utilities.cpp)diff --git a/Libraries/LibWebCommon/WebView/SiteIsolation.cpp b/Libraries/LibWebCommon/WebView/SiteIsolation.cppdeleted file mode 100644index d314c066f91..00000000000--- a/Libraries/LibWebCommon/WebView/SiteIsolation.cpp+++ /dev/null@@ -1,34 +0,0 @@-/*- * Copyright (c) 2025, Tim Flynn <[email protected]>- *- * SPDX-License-Identifier: BSD-2-Clause- */--#include <LibWebCommon/WebView/SiteIsolation.h>--namespace WebView {--static SiteIsolationMode s_site_isolation_mode = SiteIsolationMode::IFrame;--Optional<SiteIsolationMode> site_isolation_mode_from_string(StringView mode)-{- if (mode.equals_ignoring_ascii_case("disable"sv) || mode.equals_ignoring_ascii_case("disabled"sv))- return SiteIsolationMode::Disabled;- if (mode.equals_ignoring_ascii_case("top-level"sv))- return SiteIsolationMode::TopLevel;- if (mode.equals_ignoring_ascii_case("iframe"sv) || mode.equals_ignoring_ascii_case("iframes"sv))- return SiteIsolationMode::IFrame;- return {};-}--SiteIsolationMode site_isolation_mode()-{- return s_site_isolation_mode;-}--void set_site_isolation_mode(SiteIsolationMode mode)-{- s_site_isolation_mode = mode;-}--}diff --git a/Libraries/LibWebCommon/WebView/SiteIsolation.h b/Libraries/LibWebCommon/WebView/SiteIsolation.hdeleted file mode 100644index 55ee9f38f52..00000000000--- a/Libraries/LibWebCommon/WebView/SiteIsolation.h+++ /dev/null@@ -1,26 +0,0 @@-/*- * Copyright (c) 2025, Tim Flynn <[email protected]>- *- * SPDX-License-Identifier: BSD-2-Clause- */--#pragma once--#include <AK/Optional.h>-#include <AK/StringView.h>-#include <LibWebCommon/Export.h>-#include <LibWebCommon/Forward.h>--namespace WebView {--enum class SiteIsolationMode {- Disabled,- TopLevel,- IFrame,-};--[[nodiscard]] WEBCOMMON_API Optional<SiteIsolationMode> site_isolation_mode_from_string(StringView);-[[nodiscard]] WEBCOMMON_API SiteIsolationMode site_isolation_mode();-WEBCOMMON_API void set_site_isolation_mode(SiteIsolationMode);--}diff --git a/Libraries/LibWebView/Application.cpp b/Libraries/LibWebView/Application.cppindex 8a5a305b37b..dc069e2db02 100644--- a/Libraries/LibWebView/Application.cpp+++ b/Libraries/LibWebView/Application.cpp@@ -45,7 +45,6 @@#include <LibWebCommon/Loader/UserAgent.h>#include <LibWebCommon/Page/InputEvent.h>#include <LibWebCommon/WebDriver/TimeoutsConfiguration.h>-#include <LibWebCommon/WebView/SiteIsolation.h>#include <LibWebView/Application.h>#include <LibWebView/BlobURLStore.h>#include <LibWebView/CompositorClient.h>@@ -352,7 +351,6 @@ ErrorOr<void> Application::initialize(Main::Arguments const& arguments)bool enable_test_mode = false;bool validate_dnssec_locally = false;bool log_all_js_exceptions = false;- auto site_isolation_mode = default_site_isolation_mode();Optional<size_t> maximum_site_request_servers;Optional<u64> web_content_memory_limit_in_mebibytes;bool disable_http_memory_cache = false;@@ -470,20 +468,6 @@ ErrorOr<void> Application::initialize(Main::Arguments const& arguments)#endifargs_parser.add_option(enable_test_mode, "Enable test mode", "test-mode");args_parser.add_option(log_all_js_exceptions, "Log all JavaScript exceptions", "log-all-js-exceptions");- args_parser.add_option(Core::ArgsParser::Option {- .argument_mode = Core::ArgsParser::OptionArgumentMode::Required,- .help_string = "Set site isolation mode. Mode may be 'disable', 'top-level', or 'iframe'.",- .long_name = "site-isolation",- .value_name = "mode",- .accept_value = [&](StringView value) {- auto parsed_mode = site_isolation_mode_from_string(value);- if (!parsed_mode.has_value())- return false;-- site_isolation_mode = *parsed_mode;- return true;- },- });args_parser.add_option(disable_http_memory_cache, "Disable HTTP memory cache", "disable-http-memory-cache");args_parser.add_option(disable_http_disk_cache, "Disable HTTP disk cache", "disable-http-disk-cache");args_parser.add_option(maximum_site_request_servers, "How many RequestServers a session may have for the sites it visits, 0 to share one", "max-site-request-servers", 0, "count");@@ -594,10 +578,6 @@ ErrorOr<void> Application::initialize(Main::Arguments const& arguments)m_explicit_content_blocker_list_paths = move(content_blocker_list_paths);- // Disable site isolation when debugging WebContent. Otherwise, the process swap may interfere with the gdb session.- if (debug_process_types.contains_slow(ProcessType::WebContent))- site_isolation_mode = SiteIsolationMode::Disabled;-m_browser_options = {.urls = {},.raw_urls = move(raw_urls),@@ -662,7 +642,6 @@ ErrorOr<void> Application::initialize(Main::Arguments const& arguments).user_agent_preset = move(user_agent_preset),.is_test_mode = enable_test_mode ? IsTestMode::Yes : IsTestMode::No,.log_all_js_exceptions = log_all_js_exceptions ? LogAllJSExceptions::Yes : LogAllJSExceptions::No,- .site_isolation_mode = site_isolation_mode,.enable_http_memory_cache = disable_http_memory_cache ? EnableMemoryHTTPCache::No : EnableMemoryHTTPCache::Yes,.expose_experimental_interfaces = expose_experimental_interfaces ? ExposeExperimentalInterfaces::Yes : ExposeExperimentalInterfaces::No,.expose_internals_object = expose_internals_object ? ExposeInternalsObject::Yes : ExposeInternalsObject::No,@@ -759,8 +738,6 @@ ErrorOr<void> Application::initialize(Main::Arguments const& arguments)if (m_web_content_options.file_scheme_urls_have_tuple_origins == FileSchemeUrlsHaveTupleOrigins::Yes)URL::set_file_scheme_urls_have_tuple_origins();- set_site_isolation_mode(m_web_content_options.site_isolation_mode);-if (auto result = load_content_blocker_lists(); result.is_error()) {warnln("\033[31;1mUnable to load all content blocker lists:\033[0m {}", result.error());warnln(" Configured lists: {}", m_browser_options.content_blocker_list_paths);@@ -1729,11 +1706,19 @@ void Application::crash_compositor_process()m_compositor_client->async_crash();}+TabProcesses Application::tab_processes() const+{+ // Disable site isolation when debugging WebContent. Otherwise, the process swap may interfere with the gdb session.+ if (browser_options().debug_helper_processes.contains_slow(ProcessType::WebContent))+ return TabProcesses::PerTabWithoutSiteIsolation;+ return m_settings->tab_settings().tab_processes;+}+bool Application::tabs_may_share_processes() const{// NB: Tests run side by side, and must not take each other's state with them.return m_web_content_options.is_test_mode == IsTestMode::No- && m_settings->tab_settings().tab_processes != TabProcesses::PerTab;+ && tab_processes() != TabProcesses::PerTab;}ErrorOr<NonnullRefPtr<WebContentPage>> Application::open_page_for_new_tab(IsPrivate is_private)diff --git a/Libraries/LibWebView/Application.h b/Libraries/LibWebView/Application.hindex 605a6ca0377..63537b8ea3f 100644--- a/Libraries/LibWebView/Application.h+++ b/Libraries/LibWebView/Application.h@@ -243,6 +243,7 @@ public:ErrorOr<Core::GeolocationProvider::WatchId, Core::GeolocationError> start_watching_geolocation_position(Core::GeolocationProvider::SuccessCallback on_success, Core::GeolocationProvider::ErrorCallback on_error);void stop_watching_geolocation_position(Core::GeolocationProvider::WatchId);+ TabProcesses tab_processes() const;bool tabs_may_share_processes() const;ErrorOr<NonnullRefPtr<WebContentPage>> open_page_for_new_tab(IsPrivate);struct ChildFrameWebContentProcess {@@ -446,7 +447,6 @@ protected:virtual Optional<pid_t> ui_process_id() const { return {}; }virtual bool captures_browser_crashes() const { return false; }virtual bool should_use_os_geolocation() const { return true; }- virtual SiteIsolationMode default_site_isolation_mode() const { return SiteIsolationMode::IFrame; }virtual NonnullRefPtr<Core::Promise<ByteString>> ask_user_for_download_path(ByteString const& file) const;diff --git a/Libraries/LibWebView/CanonicalNavigable.cpp b/Libraries/LibWebView/CanonicalNavigable.cppindex 7175486ef3b..a3c3ad9cf33 100644--- a/Libraries/LibWebView/CanonicalNavigable.cpp+++ b/Libraries/LibWebView/CanonicalNavigable.cpp@@ -15,7 +15,6 @@#include <LibWebCommon/HTML/SerializationRecords.h>#include <LibWebCommon/Page/ViewportIsFullscreen.h>#include <LibWebCommon/SecureContexts/AbstractOperations.h>-#include <LibWebCommon/WebView/SiteIsolation.h>#include <LibWebView/Application.h>#include <LibWebView/BrowsingSession.h>#include <LibWebView/CanonicalBrowsingContext.h>@@ -914,8 +913,7 @@ RefPtr<WebContentClient> CanonicalNavigable::process_to_host_for_site_isolation(return process;// Documents that are not isolated go with the page holding the navigable.- auto mode = site_isolation_mode();- if (mode == SiteIsolationMode::Disabled || (mode == SiteIsolationMode::TopLevel && parent()))+ if (Application::the().tab_processes() == TabProcesses::PerTabWithoutSiteIsolation)return process_holding_navigable;// A sandboxed document stays out of its initiator's process, and the sandboxed documents of an origin share one@@ -980,7 +978,7 @@ RefPtr<WebContentClient> CanonicalNavigable::process_to_host(CanonicalDocument c// NB: Without site isolation, every document stays with the process holding its navigable, local file content and// WebUI documents too, and that process may then read local files or speak for the WebUI for as long as it lives.- if (site_isolation_mode() == SiteIsolationMode::Disabled)+ if (Application::the().tab_processes() == TabProcesses::PerTabWithoutSiteIsolation)return process;auto process_has_hosted_local_file_content = process && process->has_hosted_local_file_content();auto process_has_hosted_web_ui = process && process->hosted_web_ui().has_value();@@ -1013,7 +1011,7 @@ RefPtr<WebContentClient> CanonicalNavigable::process_to_host(CanonicalDocument cErrorOr<NonnullRefPtr<WebContentPage>> CanonicalNavigable::obtain_page_to_host(CanonicalDocument const& document, Optional<URL::Origin> const& initiator_origin){auto page = TRY(obtain_page_to_host_in(process_to_host(document, initiator_origin)));- if (site_isolation_mode() == SiteIsolationMode::IFrame) {+ if (Application::the().tab_processes() != TabProcesses::PerTabWithoutSiteIsolation) {if (auto origin = origin_of_sandboxed_document(*this, document); origin.has_value()) {document.browsing_context().top_level_browsing_context().group()->set_process_hosting_sandboxed_documents_of_origin(*origin, page->client());// NB: A sandboxed srcdoc or data: URL iframe of local file content loads files as that content can.diff --git a/Libraries/LibWebView/CanonicalTraversable.cpp b/Libraries/LibWebView/CanonicalTraversable.cppindex fdfc3c78361..01b560e1911 100644--- a/Libraries/LibWebView/CanonicalTraversable.cpp+++ b/Libraries/LibWebView/CanonicalTraversable.cpp@@ -10,7 +10,6 @@#include <AK/TemporaryChange.h>#include <LibCore/EventLoop.h>#include <LibURL/Site.h>-#include <LibWebCommon/WebView/SiteIsolation.h>#include <LibWebView/Application.h>#include <LibWebView/CanonicalBrowsingContext.h>#include <LibWebView/CanonicalBrowsingContextGroup.h>diff --git a/Libraries/LibWebView/ImageDecoderManager.cpp b/Libraries/LibWebView/ImageDecoderManager.cppindex d02a1cb9c9e..5b1b92adcee 100644--- a/Libraries/LibWebView/ImageDecoderManager.cpp+++ b/Libraries/LibWebView/ImageDecoderManager.cpp@@ -4,7 +4,6 @@* SPDX-License-Identifier: BSD-2-Clause*/-#include <LibWebCommon/WebView/SiteIsolation.h>#include <LibWebView/Application.h>#include <LibWebView/HelperProcess.h>#include <LibWebView/ImageDecoderControlClient.h>@@ -22,7 +21,7 @@ ImageDecoderManager::~ImageDecoderManager() = default;ErrorOr<IPC::TransportHandle> ImageDecoderManager::connect_new_client(u64 client_child_id, RefPtr<BrowsingSession> const& session, Optional<Utf16String> site){- if (site_isolation_mode() != SiteIsolationMode::IFrame || !session)+ if (Application::the().tab_processes() == TabProcesses::PerTabWithoutSiteIsolation || !session)site.clear();// NB: A decoder that died is of no use to anyone, whether or not its clients have noticed yet.diff --git a/Libraries/LibWebView/Options.h b/Libraries/LibWebView/Options.hindex 1725e60ef70..84b0d9642f3 100644--- a/Libraries/LibWebView/Options.h+++ b/Libraries/LibWebView/Options.h@@ -14,7 +14,6 @@#include <AK/Vector.h>#include <LibHTTP/Proxy.h>#include <LibURL/URL.h>-#include <LibWebCommon/WebView/SiteIsolation.h>#include <LibWebView/ProcessType.h>namespace WebView {@@ -193,7 +192,6 @@ struct WebContentOptions {Optional<StringView> user_agent_preset {};IsTestMode is_test_mode { IsTestMode::No };LogAllJSExceptions log_all_js_exceptions { LogAllJSExceptions::No };- SiteIsolationMode site_isolation_mode { SiteIsolationMode::IFrame };EnableMemoryHTTPCache enable_http_memory_cache { EnableMemoryHTTPCache::No };ExposeExperimentalInterfaces expose_experimental_interfaces { ExposeExperimentalInterfaces::No };ExposeInternalsObject expose_internals_object { ExposeInternalsObject::No };diff --git a/Libraries/LibWebView/Settings.cpp b/Libraries/LibWebView/Settings.cppindex 6cadb1144c9..f13fb7f7b0d 100644--- a/Libraries/LibWebView/Settings.cpp+++ b/Libraries/LibWebView/Settings.cpp@@ -357,6 +357,8 @@ static constexpr StringView tab_processes_to_string(TabProcesses tab_processes)return "perOrigin"sv;case TabProcesses::PerSite:return "perSite"sv;+ case TabProcesses::PerTabWithoutSiteIsolation:+ break;}VERIFY_NOT_REACHED();}diff --git a/Libraries/LibWebView/Settings.h b/Libraries/LibWebView/Settings.hindex ff82a1f5999..5bc74ce7d21 100644--- a/Libraries/LibWebView/Settings.h+++ b/Libraries/LibWebView/Settings.h@@ -90,6 +90,7 @@ enum class TabProcesses : u8 {PerTab,PerOrigin,PerSite,+ PerTabWithoutSiteIsolation,};enum class VerticalTabsPosition : u8 {diff --git a/Libraries/LibWebView/ViewImplementation.cpp b/Libraries/LibWebView/ViewImplementation.cppindex acc35c04242..7819bc1fd65 100644--- a/Libraries/LibWebView/ViewImplementation.cpp+++ b/Libraries/LibWebView/ViewImplementation.cpp@@ -28,7 +28,6 @@#include <LibWebCommon/Loader/ContentBlocking.h>#include <LibWebCommon/WebDriver/Error.h>#include <LibWebCommon/WebDriver/Input.h>-#include <LibWebCommon/WebView/SiteIsolation.h>#include <LibWebCommon/WebView/Utilities.h>#include <LibWebView/Application.h>#include <LibWebView/CanonicalSessionHistoryEntry.h>diff --git a/Libraries/LibWebView/WebContentClient.cpp b/Libraries/LibWebView/WebContentClient.cppindex 175d6139d8e..5025dc0247b 100644--- a/Libraries/LibWebView/WebContentClient.cpp+++ b/Libraries/LibWebView/WebContentClient.cpp@@ -22,7 +22,6 @@#include <LibWebCommon/HTML/BrowsingContext.h>#include <LibWebCommon/Page/InputEvent.h>#include <LibWebCommon/WebDriver/Error.h>-#include <LibWebCommon/WebView/SiteIsolation.h>#include <LibWebView/Application.h>#include <LibWebView/AudioServerControlClient.h>#include <LibWebView/BlobURLStore.h>@@ -114,7 +113,7 @@ void WebContentClient::note_hosted_document(CanonicalDocument const& document)static bool tabs_of_a_site_share_processes(){- return Application::settings().tab_settings().tab_processes == TabProcesses::PerSite;+ return Application::the().tab_processes() == TabProcesses::PerSite;}bool WebContentClient::has_hosted_only_tabs_like(CanonicalDocument const& document) const@@ -128,7 +127,7 @@ bool WebContentClient::has_hosted_only_tabs_like(CanonicalDocument const& documebool WebContentClient::has_hosted_only_tabs_unlike(CanonicalDocument const& document) const{// NB: The user may want no tabs to share a process, which makes every other tab unlike the tabs of a process.- if (Application::settings().tab_settings().tab_processes == TabProcesses::PerTab)+ if (Application::the().tab_processes() == TabProcesses::PerTab)return m_origin_of_hosted_tabs.has_value();if (tabs_of_a_site_share_processes())return m_origin_of_hosted_tabs.has_value() && !has_hosted_only_tabs_of_the_site_of(document);diff --git a/Libraries/LibWebView/WebContentPage.cpp b/Libraries/LibWebView/WebContentPage.cppindex 2102abf9d2b..35137efc5b7 100644--- a/Libraries/LibWebView/WebContentPage.cpp+++ b/Libraries/LibWebView/WebContentPage.cpp@@ -16,7 +16,6 @@#include <LibWebCommon/Page/InputEvent.h>#include <LibWebCommon/SecureContexts/AbstractOperations.h>#include <LibWebCommon/WebDriver/Error.h>-#include <LibWebCommon/WebView/SiteIsolation.h>#include <LibWebView/Application.h>#include <LibWebView/BlobURLStore.h>#include <LibWebView/BrowsingSession.h>diff --git a/Libraries/LibWebView/WorkerAgentManager.cpp b/Libraries/LibWebView/WorkerAgentManager.cppindex 45ececcd299..8786de6e009 100644--- a/Libraries/LibWebView/WorkerAgentManager.cpp+++ b/Libraries/LibWebView/WorkerAgentManager.cpp@@ -9,7 +9,6 @@#include <LibCore/Timer.h>#include <LibIPC/File.h>#include <LibURL/Parser.h>-#include <LibWebCommon/WebView/SiteIsolation.h>#include <LibWebView/Application.h>#include <LibWebView/CanonicalEnvironmentSettingsObject.h>#include <LibWebView/CanonicalNavigable.h>@@ -332,15 +331,7 @@ bool WorkerAgentManager::owner_process_may_host_shared_worker(Owner const& owner// NB: Nothing in a cross-origin isolated process may have been loaded without the consent of its origin. A shared// worker is in an agent cluster of its own, and needs no such consent unless its response says so.- if (page->hosted_environment_is_cross_origin_isolated(outside_settings.id()).value_or(true))- return false;-- // NB: Isolating only top-level documents leaves a cross-site frame with the process of its parent's site.- if (site_isolation_mode() == SiteIsolationMode::TopLevel) {- auto top_level_origin = outside_settings.top_level_origin();- return top_level_origin.has_value() && top_level_origin->is_same_site(outside_settings.origin());- }- return true;+ return !page->hosted_environment_is_cross_origin_isolated(outside_settings.id()).value_or(true);}bool WorkerAgentManager::hosts_shared_worker(WebContentClient const& process) constdiff --git a/Services/WebDriver/main.cpp b/Services/WebDriver/main.cppindex e875feba218..d19798a1295 100644--- a/Services/WebDriver/main.cpp+++ b/Services/WebDriver/main.cpp@@ -18,7 +18,6 @@#include <LibFileSystem/FileSystem.h>#include <LibMain/Main.h>#include <LibWebCommon/WebDriver/Capabilities.h>-#include <LibWebCommon/WebView/SiteIsolation.h>#include <LibWebCommon/WebView/Utilities.h>#include <WebDriver/Client.h>#include <WebDriver/Session.h>@@ -39,7 +38,7 @@ static ErrorOr<Core::Process> launch_process(StringView application, ReadonlySpareturn result;}-static Vector<ByteString> create_arguments(ByteString const& webdriver_endpoint, Optional<StringView> profile_name, Optional<StringView> profile_path, bool headless, bool expose_experimental_interfaces, bool expose_internals_object, bool force_cpu_painting, bool disable_sandbox, Optional<StringView> debug_process, Optional<StringView> default_time_zone, Optional<StringView> resource_substitution_map_path, StringView site_isolation_mode, Optional<ByteString> const& proxy_autoconfig_url)+static Vector<ByteString> create_arguments(ByteString const& webdriver_endpoint, Optional<StringView> profile_name, Optional<StringView> profile_path, bool headless, bool expose_experimental_interfaces, bool expose_internals_object, bool force_cpu_painting, bool disable_sandbox, Optional<StringView> debug_process, Optional<StringView> default_time_zone, Optional<StringView> resource_substitution_map_path, Optional<ByteString> const& proxy_autoconfig_url){Vector<ByteString> arguments;#if defined(AK_OS_MACOS)@@ -86,8 +85,6 @@ static Vector<ByteString> create_arguments(ByteString const& webdriver_endpoint,if (proxy_autoconfig_url.has_value())arguments.append(ByteString::formatted("--proxy-autoconfig-url={}", *proxy_autoconfig_url));- arguments.append(ByteString::formatted("--site-isolation={}", site_isolation_mode));-if (auto* stats_log = Core::StatsLog::the())arguments.append(ByteString::formatted("--stats-log-dir={}", stats_log->directory()));@@ -118,7 +115,6 @@ ErrorOr<int> ladybird_main(Main::Arguments arguments)Optional<StringView> profile_path;Optional<StringView> profiles_directory;Optional<StringView> resource_substitution_map_path;- StringView site_isolation_mode = "iframe"sv;StringView stats_log_directory;Core::ArgsParser args_parser;@@ -137,18 +133,6 @@ ErrorOr<int> ladybird_main(Main::Arguments arguments)args_parser.add_option(profile_path, "Use a self-contained browser profile at an absolute path", "profile-path", 0, "path");args_parser.add_option(profiles_directory, "Directory in which to create the browser profile", "profiles-directory", 0, "path");args_parser.add_option(resource_substitution_map_path, "Path to JSON file mapping URLs to local files", "resource-map", 0, "path");- args_parser.add_option(Core::ArgsParser::Option {- .argument_mode = Core::ArgsParser::OptionArgumentMode::Required,- .help_string = "Launch browser with the given site isolation mode ('disable', 'top-level', or 'iframe')",- .long_name = "site-isolation",- .value_name = "mode",- .accept_value = [&](StringView value) {- if (!WebView::site_isolation_mode_from_string(value).has_value())- return false;- site_isolation_mode = value;- return true;- },- });args_parser.parse(arguments);auto stats_log = TRY(Core::StatsLog::create(stats_log_directory, "WebDriver"sv));@@ -222,7 +206,7 @@ ErrorOr<int> ladybird_main(Main::Arguments arguments)}auto launch_browser_callback = [&](ByteString const& webdriver_endpoint, bool headless, Optional<ByteString> const& proxy_autoconfig_url) {- auto arguments = create_arguments(webdriver_endpoint, profile_name, profile_path, headless, expose_experimental_interfaces, expose_internals_object, force_cpu_painting, disable_sandbox, debug_process, default_time_zone, resource_substitution_map_path, site_isolation_mode, proxy_autoconfig_url);+ auto arguments = create_arguments(webdriver_endpoint, profile_name, profile_path, headless, expose_experimental_interfaces, expose_internals_object, force_cpu_painting, disable_sandbox, debug_process, default_time_zone, resource_substitution_map_path, proxy_autoconfig_url);return launch_process("Ladybird"sv, arguments.span());};diff --git a/Tests/LibWebView/TestCanonicalBrowsingContextGroup.cpp b/Tests/LibWebView/TestCanonicalBrowsingContextGroup.cppindex ac502c643cf..6254a98f616 100644--- a/Tests/LibWebView/TestCanonicalBrowsingContextGroup.cpp+++ b/Tests/LibWebView/TestCanonicalBrowsingContextGroup.cpp@@ -7,7 +7,6 @@#include <AK/ScopeGuard.h>#include <LibTest/TestCase.h>#include <LibURL/Parser.h>-#include <LibWebCommon/WebView/SiteIsolation.h>#include <LibWebView/CanonicalBrowsingContext.h>#include <LibWebView/CanonicalBrowsingContextGroup.h>#include <LibWebView/CanonicalDocument.h>diff --git a/Tests/LibWebView/TestImageDecoderIsolation.cpp b/Tests/LibWebView/TestImageDecoderIsolation.cppindex c63cdb98767..849263fce3a 100644--- a/Tests/LibWebView/TestImageDecoderIsolation.cpp+++ b/Tests/LibWebView/TestImageDecoderIsolation.cpp@@ -17,7 +17,6 @@#include <LibImageDecoderClient/Client.h>#include <LibTest/TestCase.h>#include <LibURL/URL.h>-#include <LibWebCommon/WebView/SiteIsolation.h>#include <LibWebView/Application.h>#include <LibWebView/HeadlessWebView.h>#include <LibWebView/ImageDecoderManager.h>@@ -261,20 +260,12 @@ TEST_CASE(image_decoder_sharing_rules)connect(1'000'006, ordinary_session, {});VERIFY(decoder_count() == 5);- // Without site isolation a process may host anything, so its claim to a site does not make it safe to share with.- auto mode = WebView::site_isolation_mode();- WebView::set_site_isolation_mode(WebView::SiteIsolationMode::TopLevel);- connect(1'000'007, ordinary_session, site_a);- connect(1'000'008, ordinary_session, site_a);- WebView::set_site_isolation_mode(mode);- VERIFY(decoder_count() == 7);-// A session that has ended shares nothing with the next, nor does a worker that outlived its session.private_session = nullptr;connect(1'000'009, WebView::Application::session_for_new_view(WebView::IsPrivate::Yes), site_a);- VERIFY(decoder_count() == 8);+ VERIFY(decoder_count() == 6);connect(1'000'010, nullptr, site_a);- VERIFY(decoder_count() == 9);+ VERIFY(decoder_count() == 7);// Only a process served by the decoder of a site has one to leave.VERIFY(manager.remove_client_from_decoder_of_site(1'000'002));@@ -290,16 +281,16 @@ TEST_CASE(image_decoder_sharing_rules)return !processes_of_type(WebView::ProcessType::ImageDecoder).contains(crashed_decoder);});connect(1'000'003, ordinary_session, site_b);- VERIFY(decoder_count() == 9);+ VERIFY(decoder_count() == 7);VERIFY(decoder_of_site("b.example"sv) != crashed_decoder);VERIFY(processes_of_type(WebView::ProcessType::ImageDecoder).contains(decoder_of_a));// A decoder ends with the last process it serves, and not before.handles.clear();manager.process_did_exit(1'000'003);- Core::EventLoop::current().spin_until([&] { return decoder_count() == 8; });+ Core::EventLoop::current().spin_until([&] { return decoder_count() == 6; });manager.process_did_exit(1'000'005);- Core::EventLoop::current().spin_until([&] { return decoder_count() == 7; });+ Core::EventLoop::current().spin_until([&] { return decoder_count() == 5; });for (u64 child_id = 1'000'001; child_id <= 1'000'010; ++child_id)manager.process_did_exit(child_id);Core::EventLoop::current().spin_until([&] { return decoder_count() == 0; });diff --git a/Tests/LibWebView/test-webdriver-bidi.py b/Tests/LibWebView/test-webdriver-bidi.pyindex 4565697fac7..964dd4847e3 100755--- a/Tests/LibWebView/test-webdriver-bidi.py+++ b/Tests/LibWebView/test-webdriver-bidi.py@@ -2917,7 +2917,6 @@ def run_test(webdriver_binary,"--headless","--expose-internals-object",- "--site-isolation=iframe",f"--profile-path={profile}",env={**os.environ, "XDG_DOWNLOAD_DIR": downloads},)diff --git a/UI/Android/src/main/cpp/WebContentService.cpp b/UI/Android/src/main/cpp/WebContentService.cppindex b71123a26fe..a8500fca7c1 100644--- a/UI/Android/src/main/cpp/WebContentService.cpp+++ b/UI/Android/src/main/cpp/WebContentService.cpp@@ -24,7 +24,6 @@#include <LibWeb/Platform/EventLoopPlugin.h>#include <LibWeb/Platform/FontPlugin.h>#include <LibWeb/Platform/RemoteImageCodecPlugin.h>-#include <LibWebCommon/WebView/SiteIsolation.h>#include <LibWebView/HelperProcess.h>#include <LibWebView/Utilities.h>#include <WebContent/ConnectionFromClient.h>@@ -61,11 +60,6 @@ ErrorOr<int> service_main(int ipc_socket)Web::HTML::Window::set_internals_object_exposed(is_test_mode);Web::Platform::FontPlugin::install(*new Web::Platform::FontPlugin(is_test_mode));- // Currently site isolation doesn't work on Android since everything is running- // in the same process. It would require an entire redesign of this port- // in order to make it work. For now, it's better to just disable it.- WebView::set_site_isolation_mode(WebView::SiteIsolationMode::Disabled);-auto webcontent_socket = TRY(Core::LocalSocket::adopt_fd(ipc_socket));auto webcontent_client = TRY(WebContent::ConnectionFromClient::try_create(make<IPC::Transport>(move(webcontent_socket))));