docs: ses.setUserAgent(userAgent[, acceptLanguages])

This commit is contained in:
Cheng Zhao 2016-06-22 16:05:38 +09:00
parent 01bc8305f8
commit 6b1df5838c

View 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