mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 08:11:13 +00:00
UI/AppKit: Update the User-Agent to the provided UA override name
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-22.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-22.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-22.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-22.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-22.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-22.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-22.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-22.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
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: https://github.com/LadybirdBrowser/ladybird/commit/e2ff234ac25 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1215 Reviewed-by: https://github.com/tcl3 ✅
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -93,6 +93,10 @@ static NSString* const TOOLBAR_TAB_OVERVIEW_IDENTIFIER = @"ToolbarTabOverviewIde
|
|||
[self.toolbar setSizeMode:NSToolbarSizeModeRegular];
|
||||
|
||||
m_settings = { .block_popups = WebView::Application::chrome_options().allow_popups == WebView::AllowPopups::Yes ? NO : YES };
|
||||
|
||||
if (auto const& user_agent_preset = WebView::Application::web_content_options().user_agent_preset; user_agent_preset.has_value())
|
||||
m_settings.user_agent_name = *user_agent_preset;
|
||||
|
||||
m_can_navigate_back = false;
|
||||
m_can_navigate_forward = false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue