chore: remove deprecated APIs (#18159)
This commit is contained in:
parent
96e19f1cc4
commit
019b31d084
7 changed files with 35 additions and 126 deletions
|
@ -19,6 +19,41 @@ session.clearAuthCache({ type: 'password' })
|
|||
session.clearAuthCache()
|
||||
```
|
||||
|
||||
### `powerMonitor.querySystemIdleState`
|
||||
|
||||
```js
|
||||
// Removed in Electron 7.0
|
||||
powerMonitor.querySystemIdleState(threshold, callback)
|
||||
// Replace with synchronous API
|
||||
const idleState = getSystemIdleState(threshold)
|
||||
```
|
||||
|
||||
### `powerMonitor.querySystemIdleTime`
|
||||
|
||||
```js
|
||||
// Removed in Electron 7.0
|
||||
powerMonitor.querySystemIdleTime(callback)
|
||||
// Replace with synchronous API
|
||||
const idleTime = getSystemIdleTime()
|
||||
```
|
||||
|
||||
### webFrame Isolated World APIs
|
||||
|
||||
```js
|
||||
// Removed in Elecron 7.0
|
||||
webFrame.setIsolatedWorldContentSecurityPolicy(worldId, csp)
|
||||
webFrame.setIsolatedWorldHumanReadableName(worldId, name)
|
||||
webFrame.setIsolatedWorldSecurityOrigin(worldId, securityOrigin)
|
||||
// Replace with
|
||||
webFrame.setIsolatedWorldInfo(
|
||||
worldId,
|
||||
{
|
||||
securityOrigin: 'some_origin',
|
||||
name: 'human_readable_name',
|
||||
csp: 'content_security_policy'
|
||||
})
|
||||
```
|
||||
|
||||
## Planned Breaking API Changes (6.0)
|
||||
|
||||
### `win.setMenu(null)`
|
||||
|
|
|
@ -59,24 +59,6 @@ Emitted as soon as the systems screen is unlocked.
|
|||
|
||||
The `powerMonitor` module has the following methods:
|
||||
|
||||
### `powerMonitor.querySystemIdleState(idleThreshold, callback)` _(Deprecated)_
|
||||
|
||||
* `idleThreshold` Integer
|
||||
* `callback` Function
|
||||
* `idleState` String - Can be `active`, `idle`, `locked` or `unknown`
|
||||
|
||||
Calculate the system idle state. `idleThreshold` is the amount of time (in seconds)
|
||||
before considered idle. `callback` will be called synchronously on some systems
|
||||
and with an `idleState` argument that describes the system's state. `locked` is
|
||||
available on supported systems only.
|
||||
|
||||
### `powerMonitor.querySystemIdleTime(callback)` _(Deprecated)_
|
||||
|
||||
* `callback` Function
|
||||
* `idleTime` Integer - Idle time in seconds
|
||||
|
||||
Calculate system idle time in seconds.
|
||||
|
||||
### `powerMonitor.getSystemIdleState(idleThreshold)`
|
||||
|
||||
* `idleThreshold` Integer
|
||||
|
|
|
@ -132,27 +132,6 @@ or is rejected if the result of the code is a rejected promise.
|
|||
|
||||
Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
|
||||
|
||||
### `webFrame.setIsolatedWorldContentSecurityPolicy(worldId, csp)` _(Deprecated)_
|
||||
|
||||
* `worldId` Integer - The ID of the world to run the javascript in, `0` is the default world, `999` is the world used by Electrons `contextIsolation` feature. Chrome extensions reserve the range of IDs in `[1 << 20, 1 << 29)`. You can provide any integer here.
|
||||
* `csp` String
|
||||
|
||||
Set the content security policy of the isolated world.
|
||||
|
||||
### `webFrame.setIsolatedWorldHumanReadableName(worldId, name)` _(Deprecated)_
|
||||
|
||||
* `worldId` Integer - The ID of the world to run the javascript in, `0` is the default world, `999` is the world used by Electrons `contextIsolation` feature. Chrome extensions reserve the range of IDs in `[1 << 20, 1 << 29)`. You can provide any integer here.
|
||||
* `name` String
|
||||
|
||||
Set the name of the isolated world. Useful in devtools.
|
||||
|
||||
### `webFrame.setIsolatedWorldSecurityOrigin(worldId, securityOrigin)` _(Deprecated)_
|
||||
|
||||
* `worldId` Integer - The ID of the world to run the javascript in, `0` is the default world, `999` is the world used by Electrons `contextIsolation` feature. Chrome extensions reserve the range of IDs in `[1 << 20, 1 << 29)`. You can provide any integer here.
|
||||
* `securityOrigin` String
|
||||
|
||||
Set the security origin of the isolated world.
|
||||
|
||||
### `webFrame.setIsolatedWorldInfo(worldId, info)`
|
||||
* `worldId` Integer - The ID of the world to run the javascript in, `0` is the default world, `999` is the world used by Electrons `contextIsolation` feature. Chrome extensions reserve the range of IDs in `[1 << 20, 1 << 29)`. You can provide any integer here.
|
||||
* `info` Object
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue