@@ -241,6 +241,13 @@ Here are some settings worth noting:
241241 customize context menu
242242- [ locale] ( ../api/ApplicationSettings.md#locale ) - set language
243243 for localized resources
244+ - [ product_version] ( ../api/ApplicationSettings.md#product_version ) -
245+ set the product portion of the default User-Agent string.
246+ If user_agent option (below) is used then product_version will
247+ be ignored.
248+ - [ user_agent] ( ../api/ApplicationSettings.md#user_agent ) - set
249+ value that will be returned as the User-Agent HTTP header
250+ and js navigator.userAgent
244251
245252To enable debugging set these settings:
246253``` python
@@ -290,6 +297,45 @@ wasn't yet exposed to CEF Python, see [Issue #244](../../../issues/244)
290297for details.
291298
292299
300+ ## Change user agent string
301+
302+ There are two options in [ application settings] ( ../api/ApplicationSettings.md )
303+ for changing User-Agent string: [ product_version] ( ../api/ApplicationSettings.md#product_version )
304+ and [ user_agent] ( ../api/ApplicationSettings.md#user_agent ) .
305+
306+ The "product_version" sets the product portion of the default
307+ User-Agent string. If "user_agent" option is used then
308+ "product_version" will be ignored. For example if you set
309+ "product_version" to "MyProduct/10.00" then User-Agent will
310+ be:
311+
312+ ``` text
313+ Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko)
314+ MyProduct/10.00 Safari/537.36
315+ ```
316+
317+ To change the whole user agent string use the "user_agent"
318+ option. For example set it to "MyApp/40.00 MyProduct/10.00"
319+ and both User-Agent HTTP header and js navigator.userAgent will be:
320+
321+ ``` text
322+ MyAgent/20.00 MyProduct/10.00
323+ ```
324+
325+ Uncomment appropriate lines in [ tutorial.py] ( ../examples/tutorial.py )
326+ example to see the effect:
327+
328+ ``` Python
329+ # To change user agent use either "product_version"
330+ # or "user_agent" options. Explained in Tutorial in
331+ # "Change user agent string" section.
332+ settings = {
333+ # "product_version": "MyProduct/10.00",
334+ # "user_agent": "MyAgent/20.00 MyProduct/10.00",
335+ }
336+ ```
337+
338+
293339## Client handlers
294340
295341In CEF [ client handlers] ( ../api/API-categories.md#client-handlers-interfaces )
0 commit comments