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

LaunchServer+LibDesktop: Add ability to allow URL without handler

This lets clients say they want to be able to open a specific URL
without specifying which handler to use.
This commit is contained in:
Andreas Kling 2021-01-03 12:03:13 +01:00
parent 43c2b66b18
commit 70c59dcbf8
5 changed files with 48 additions and 18 deletions

View file

@ -78,6 +78,16 @@ static LaunchServerConnection& connection()
return connection;
}
bool Launcher::add_allowed_url(const URL& url)
{
auto response = connection().send_sync<Messages::LaunchServer::AddAllowedURL>(url);
if (!response) {
dbgln("Launcher::add_allowed_url: Failed");
return false;
}
return true;
}
bool Launcher::add_allowed_handler_with_any_url(const String& handler)
{
auto response = connection().send_sync<Messages::LaunchServer::AddAllowedHandlerWithAnyURL>(handler);
@ -98,11 +108,11 @@ bool Launcher::add_allowed_handler_with_only_specific_urls(const String& handler
return true;
}
bool Launcher::seal_allowed_handler_list()
bool Launcher::seal_allowlist()
{
auto response = connection().send_sync<Messages::LaunchServer::SealAllowedHandlersList>();
auto response = connection().send_sync<Messages::LaunchServer::SealAllowlist>();
if (!response) {
dbgln("Launcher::seal_allowed_handler_list: Failed");
dbgln("Launcher::seal_allowlist: Failed");
return false;
}
return true;