mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
UI/AppKit: Update the User-Agent to the provided UA override name
This commit is contained in:
parent
0464212f82
commit
e2ff234ac2
Notes:
github-actions[bot]
2024-08-29 12:06:46 +00:00
Author: https://github.com/trflynn89
Commit: e2ff234ac2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1215
Reviewed-by: https://github.com/tcl3 ✅
2 changed files with 10 additions and 0 deletions
|
@ -11,6 +11,7 @@
|
|||
#include <LibIPC/File.h>
|
||||
#include <LibWeb/Crypto/Crypto.h>
|
||||
#include <LibWebView/Application.h>
|
||||
#include <LibWebView/UserAgent.h>
|
||||
#include <UI/LadybirdWebViewBridge.h>
|
||||
|
||||
#import <UI/Palette.h>
|
||||
|
@ -176,6 +177,11 @@ void WebViewBridge::initialize_client(CreateNewClient)
|
|||
if (auto const& webdriver_content_ipc_path = WebView::Application::chrome_options().webdriver_content_ipc_path; webdriver_content_ipc_path.has_value()) {
|
||||
client().async_connect_to_webdriver(m_client_state.page_index, *webdriver_content_ipc_path);
|
||||
}
|
||||
|
||||
if (auto const& user_agent_preset = WebView::Application::web_content_options().user_agent_preset; user_agent_preset.has_value()) {
|
||||
auto user_agent = *WebView::user_agents.get(*user_agent_preset);
|
||||
client().async_debug_request(m_client_state.page_index, "spoof-user-agent"sv, user_agent);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue