docs: ses.setUserAgent(userAgent[, acceptLanguages])
authorCheng Zhao <zcbenz@gmail.com>
Wed, 22 Jun 2016 07:05:38 +0000 (16:05 +0900)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 22 Jun 2016 07:05:38 +0000 (16:05 +0900)
docs/api/session.md

index 0486b1d..1b23ff5 100644 (file)
@@ -341,6 +341,23 @@ session.defaultSession.allowNTLMCredentialsForDomains('*example.com, *foobar.com
 session.defaultSession.allowNTLMCredentialsForDomains('*')
 ```
 
+#### `ses.setUserAgent(userAgent[, acceptLanguages])`
+
+* `userAgent` String
+* `acceptLanguages` String (optional)
+
+Overrides the `userAgent` and `acceptLanguages` for this session.
+
+The `acceptLanguages` must a comma separated ordered list of language codes, for
+example `"en-US,fr,de,ko,zh-CN,ja"`.
+
+This doesn't affect existing `WebContents`, and each `WebContents` can use
+`webContents.setUserAgent` to override the session-wide user agent.
+
+#### `ses.getUserAgent()`
+
+Returns a `String` representing the user agent for this session.
+
 #### `ses.webRequest`
 
 The `webRequest` API set allows to intercept and modify contents of a request at