1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:48:12 +00:00

LibWeb: Add AO for navigation_must_be_a_replace to Navigable

This is used by both Navigable and Navigation, so let's put it in
Navigable. Also add a missing AK/String include to make clangd happier
with the Navigable file.
This commit is contained in:
Andrew Kaster 2023-08-24 16:18:40 -06:00 committed by Andreas Kling
parent 7ad45d9e71
commit 34ea470d4f
2 changed files with 9 additions and 0 deletions

View file

@ -1113,4 +1113,10 @@ void Navigable::reload()
});
}
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#the-navigation-must-be-a-replace
bool navigation_must_be_a_replace(AK::URL const& url, DOM::Document const& document)
{
return url.scheme() == "javascript"sv || document.is_initial_about_blank();
}
}