chore: remove promisification deprecation callbacks (#17907)

* chore: remove promisification deprecation callbacks

* update docs

* fix smoke test

* fix executejs issue

* cleanup leftovers

* fix webContents.executeJavaScript tests

* cleanup WebContents.prototype.takeHeapSnapshot

* fix "sets arbitrary webContents as devtools" test

* fix executeJavaScriptInFrame related tests
This commit is contained in:
Shelley Vohr 2019-04-30 07:08:33 -07:00 committed by John Kleinschmidt
parent fdf5f838f4
commit d87b3ead76
44 changed files with 94 additions and 1418 deletions

View file

@ -93,51 +93,16 @@ session.defaultSession.on('will-download', (event, item, webContents) => {
The following methods are available on instances of `Session`:
#### `ses.getCacheSize(callback)`
* `callback` Function
* `size` Integer - Cache size used in bytes.
* `error` Integer - The error code corresponding to the failure.
Callback is invoked with the session's current cache size.
**[Deprecated Soon](modernization/promisification.md)**
#### `ses.getCacheSize()`
Returns `Promise<Integer>` - the session's current cache size, in bytes.
#### `ses.clearCache(callback)`
* `callback` Function - Called when operation is done.
* `error` Integer - The error code corresponding to the failure.
Clears the sessions HTTP cache.
**[Deprecated Soon](modernization/promisification.md)**
#### `ses.clearCache()`
Returns `Promise<void>` - resolves when the cache clear operation is complete.
Clears the sessions HTTP cache.
#### `ses.clearStorageData([options,] callback)`
* `options` Object (optional)
* `origin` String (optional) - Should follow `window.location.origin`s representation
`scheme://host:port`.
* `storages` String[] (optional) - The types of storages to clear, can contain:
`appcache`, `cookies`, `filesystem`, `indexdb`, `localstorage`,
`shadercache`, `websql`, `serviceworkers`, `cachestorage`.
* `quotas` String[] (optional) - The types of quotas to clear, can contain:
`temporary`, `persistent`, `syncable`.
* `callback` Function (optional) - Called when operation is done.
Clears the storage data for the current session.
**[Deprecated Soon](modernization/promisification.md)**
#### `ses.clearStorageData([options])`
* `options` Object (optional)
@ -155,84 +120,6 @@ Returns `Promise<void>` - resolves when the storage data has been cleared.
Writes any unwritten DOMStorage data to disk.
#### `ses.setProxy(config, callback)`
* `config` Object
* `pacScript` String - The URL associated with the PAC file.
* `proxyRules` String - Rules indicating which proxies to use.
* `proxyBypassRules` String - Rules indicating which URLs should
bypass the proxy settings.
* `callback` Function - Called when operation is done.
Sets the proxy settings.
When `pacScript` and `proxyRules` are provided together, the `proxyRules`
option is ignored and `pacScript` configuration is applied.
The `proxyRules` has to follow the rules below:
```sh
proxyRules = schemeProxies[";"<schemeProxies>]
schemeProxies = [<urlScheme>"="]<proxyURIList>
urlScheme = "http" | "https" | "ftp" | "socks"
proxyURIList = <proxyURL>[","<proxyURIList>]
proxyURL = [<proxyScheme>"://"]<proxyHost>[":"<proxyPort>]
```
For example:
* `http=foopy:80;ftp=foopy2` - Use HTTP proxy `foopy:80` for `http://` URLs, and
HTTP proxy `foopy2:80` for `ftp://` URLs.
* `foopy:80` - Use HTTP proxy `foopy:80` for all URLs.
* `foopy:80,bar,direct://` - Use HTTP proxy `foopy:80` for all URLs, failing
over to `bar` if `foopy:80` is unavailable, and after that using no proxy.
* `socks4://foopy` - Use SOCKS v4 proxy `foopy:1080` for all URLs.
* `http=foopy,socks5://bar.com` - Use HTTP proxy `foopy` for http URLs, and fail
over to the SOCKS5 proxy `bar.com` if `foopy` is unavailable.
* `http=foopy,direct://` - Use HTTP proxy `foopy` for http URLs, and use no
proxy if `foopy` is unavailable.
* `http=foopy;socks=foopy2` - Use HTTP proxy `foopy` for http URLs, and use
`socks4://foopy2` for all other URLs.
The `proxyBypassRules` is a comma separated list of rules described below:
* `[ URL_SCHEME "://" ] HOSTNAME_PATTERN [ ":" <port> ]`
Match all hostnames that match the pattern HOSTNAME_PATTERN.
Examples:
"foobar.com", "*foobar.com", "*.foobar.com", "*foobar.com:99",
"https://x.*.y.com:99"
* `"." HOSTNAME_SUFFIX_PATTERN [ ":" PORT ]`
Match a particular domain suffix.
Examples:
".google.com", ".com", "http://.google.com"
* `[ SCHEME "://" ] IP_LITERAL [ ":" PORT ]`
Match URLs which are IP address literals.
Examples:
"127.0.1", "[0:0::1]", "[::1]", "http://[::1]:99"
* `IP_LITERAL "/" PREFIX_LENGTH_IN_BITS`
Match any URL that is to an IP literal that falls between the
given range. IP range is specified using CIDR notation.
Examples:
"192.168.1.1/16", "fefe:13::abc/33".
* `<local>`
Match local addresses. The meaning of `<local>` is whether the
host matches one of: "127.0.0.1", "::1", "localhost".
**[Deprecated Soon](modernization/promisification.md)**
#### `ses.setProxy(config)`
* `config` Object
@ -310,17 +197,6 @@ The `proxyBypassRules` is a comma separated list of rules described below:
Match local addresses. The meaning of `<local>` is whether the
host matches one of: "127.0.0.1", "::1", "localhost".
#### `ses.resolveProxy(url, callback)`
* `url` URL
* `callback` Function
* `proxy` String
Resolves the proxy information for `url`. The `callback` will be called with
`callback(proxy)` when the request is performed.
**[Deprecated Soon](modernization/promisification.md)**
#### `ses.resolveProxy(url)`
* `url` URL
@ -457,14 +333,6 @@ session.fromPartition('some-partition').setPermissionCheckHandler((webContents,
})
```
#### `ses.clearHostResolverCache(callback)`
* `callback` Function (optional) - Called when operation is done.
Clears the host resolver cache.
**[Deprecated Soon](modernization/promisification.md)**
#### `ses.clearHostResolverCache()`
Returns `Promise<void>` - Resolves when the operation is complete.
@ -506,14 +374,6 @@ This doesn't affect existing `WebContents`, and each `WebContents` can use
Returns `String` - The user agent for this session.
#### `ses.getBlobData(identifier, callback)`
* `identifier` String - Valid UUID.
* `callback` Function
* `result` Buffer - Blob data.
**[Deprecated Soon](modernization/promisification.md)**
#### `ses.getBlobData(identifier)`
* `identifier` String - Valid UUID.
@ -539,15 +399,6 @@ event. The [DownloadItem](download-item.md) will not have any `WebContents` asso
the initial state will be `interrupted`. The download will start only when the
`resume` API is called on the [DownloadItem](download-item.md).
#### `ses.clearAuthCache(options, callback)`
* `options` ([RemovePassword](structures/remove-password.md) | [RemoveClientCertificate](structures/remove-client-certificate.md))
* `callback` Function - Called when operation is done.
Clears the sessions HTTP authentication cache.
**[Deprecated Soon](modernization/promisification.md)**
#### `ses.clearAuthCache(options)`
* `options` ([RemovePassword](structures/remove-password.md) | [RemoveClientCertificate](structures/remove-client-certificate.md))