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

LibWebView: Add a helper to sanitize a user-provided URL

We currently implement several forms of this method across the Ladybird
chromes. As such, we see commits to add special URL handling that only
affects a single chrome. Instead, let's consolidate all special handling
in a single location for all chromes to make use of.

This method can handle resolving file:// URLs, falling back to a search
engine query, and validation against the Public Suffix List. These cases
were gathered from the various chromes.
This commit is contained in:
Timothy Flynn 2023-10-13 09:43:16 -04:00 committed by Tim Flynn
parent 54a28afc13
commit 191e20d639
3 changed files with 72 additions and 1 deletions

View file

@ -9,6 +9,7 @@ set(SOURCES
RequestServerAdapter.cpp
SourceHighlighter.cpp
StylePropertiesModel.cpp
URL.cpp
UserAgent.cpp
ViewImplementation.cpp
WebContentClient.cpp
@ -40,7 +41,7 @@ set(GENERATED_SOURCES
)
serenity_lib(LibWebView webview)
target_link_libraries(LibWebView PRIVATE LibCore LibGfx LibGUI LibIPC LibProtocol LibJS LibWeb LibSQL)
target_link_libraries(LibWebView PRIVATE LibCore LibFileSystem LibGfx LibGUI LibIPC LibProtocol LibPublicSuffix LibJS LibWeb LibSQL)
if (SERENITYOS)
target_link_libraries(LibWebView PRIVATE LibFileSystemAccessClient)