docs: options of session.fromPartition
This commit is contained in:
parent
753e92c845
commit
e7666b0448
1 changed files with 10 additions and 2 deletions
|
@ -20,17 +20,25 @@ const ses = win.webContents.session
|
||||||
|
|
||||||
The `session` module has the following methods:
|
The `session` module has the following methods:
|
||||||
|
|
||||||
### session.fromPartition(partition)
|
### session.fromPartition(partition[, options])
|
||||||
|
|
||||||
* `partition` String
|
* `partition` String
|
||||||
|
* `options` Object
|
||||||
|
* `cache` Boolean - Whether to enable cache.
|
||||||
|
|
||||||
Returns a new `Session` instance from `partition` string.
|
Returns a `Session` instance from `partition` string. When there is an existing
|
||||||
|
`Session` with the same `partition`, it will be returned; othewise a new
|
||||||
|
`Session` instance will be created with `options`.
|
||||||
|
|
||||||
If `partition` starts with `persist:`, the page will use a persistent session
|
If `partition` starts with `persist:`, the page will use a persistent session
|
||||||
available to all pages in the app with the same `partition`. if there is no
|
available to all pages in the app with the same `partition`. if there is no
|
||||||
`persist:` prefix, the page will use an in-memory session. If the `partition` is
|
`persist:` prefix, the page will use an in-memory session. If the `partition` is
|
||||||
empty then default session of the app will be returned.
|
empty then default session of the app will be returned.
|
||||||
|
|
||||||
|
To create a `Session` with `options`, you have to ensure the `Session` with the
|
||||||
|
`partition` has never been used before. There is no way to change the `options`
|
||||||
|
of an existing `Session` object.
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
The `session` module has the following properties:
|
The `session` module has the following properties:
|
||||||
|
|
Loading…
Add table
Reference in a new issue