Skip to content

Commit 05f48b3

Browse files
Update APIReview_UAString.md
Revised description
1 parent 5b283d6 commit 05f48b3

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

specs/APIReview_UAString.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
# Background
2-
The User Agent (UA) is a client-side piece of information that the browser/webcontrol sends to the server or website a user visits. It contains information about user’s system and is modifiable by the user.
2+
33

44
Currently, a developer can pass the --user-agent browser args to the CreateWebView2EnvironmentWithDetails function.
55
Ex. CreateWebView2EnvironmentWithDetails(nullptr, nullptr, L"--user-agent=\"myUA\"", ...);
66
For more info about the ‘—user - agent’ flag visit: https://peter.sh/experiments/chromium-command-line-switches/#user-agent.
77

88
However, there are a couple limitations to this workaround-- you cannot modify a command line switch at runtime, nor can you change the user agent per webview. In this document we describe the new API. We'd appreciate your feedback.
99

10-
# Description
10+
--
11+
1112
The Settings component will change the UA per WebView2 via Chrome Developer Protocol command (CDP). A key scenario is to allow end developers to get the current user agent from the webview and modify it based on some sort of event, such as navigating to a specific website and setting the user agent to emulate a different browser version.
1213

14+
15+
# Description
16+
17+
The User Agent (UA) is a client-side piece of information that the browser/webcontrol sends to the server or website a user visits. It contains information about user’s system and is modifiable by the user.
18+
19+
The User Agent String API allows developers to modify WebView's user agent string via Chrome Developer Protocol (CDP). The user agent can be changed based on different events such as navigation to a specific website.
20+
1321
# Examples
1422

1523
The following code snippet demonstrates how the environment APIs can be used

0 commit comments

Comments
 (0)