1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 13:25:08 +00:00

Browser+LibWeb: Add support for spoofing the browser user agent

This is helpful when testing certain sites like twitter.com which
display differently based on the user agent.
This commit is contained in:
Idan Horowitz 2021-04-14 15:13:51 +03:00 committed by Andreas Kling
parent aab99d5945
commit bc9cd55da4
5 changed files with 59 additions and 1 deletions

View file

@ -220,6 +220,10 @@ void ClientConnection::handle(const Messages::WebContentServer::DebugRequest& me
if (message.request() == "clear-cache") {
Web::ResourceLoader::the().clear_cache();
}
if (message.request() == "spoof-user-agent") {
Web::ResourceLoader::the().set_user_agent(message.argument());
}
}
void ClientConnection::handle(const Messages::WebContentServer::GetSource&)