LibWebView+WebContent: Add a command-line flag to disable site isolation

This commit is contained in:
Timothy Flynn 2025-03-11 19:25:34 -04:00 committed by Tim Ledbetter
parent 89f8dd9b3b
commit fce5d24e5f
Notes: github-actions[bot] 2025-03-12 02:02:01 +00:00
6 changed files with 28 additions and 0 deletions

View file

@ -11,8 +11,18 @@
namespace WebView {
static bool s_site_isolation_enabled = true;
void disable_site_isolation()
{
s_site_isolation_enabled = false;
}
bool is_url_suitable_for_same_process_navigation(URL::URL const& current_url, URL::URL const& target_url)
{
if (!s_site_isolation_enabled)
return true;
// Allow navigating from about:blank to any site.
if (Web::HTML::url_matches_about_blank(current_url))
return true;