chore: Add new webFrame IsolatedWorldInfo API and deprecate (#16801)

* chore: Add new webFrame IsolatedWorldInfo API and deprecate

* Flag deprecated methods in documentation

* address comments

* Address review comments

* remove unused variable

* Update based on review
This commit is contained in:
Nitish Sakhawalkar 2019-02-13 10:05:28 -08:00 committed by John Kleinschmidt
parent 1f458eb177
commit 3dfef4a376
4 changed files with 72 additions and 6 deletions

View file

@ -127,27 +127,37 @@ this limitation.
Work like `executeJavaScript` but evaluates `scripts` in an isolated context.
### `webFrame.setIsolatedWorldContentSecurityPolicy(worldId, csp)`
### `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. You can provide any integer here.
* `csp` String
Set the content security policy of the isolated world.
### `webFrame.setIsolatedWorldHumanReadableName(worldId, name)`
### `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. You can provide any integer here.
* `name` String
Set the name of the isolated world. Useful in devtools.
### `webFrame.setIsolatedWorldSecurityOrigin(worldId, securityOrigin)`
### `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. 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. You can provide any integer here.
* `info` Object
* `securityOrigin` String (optional) - Security origin for the isolated world.
* `csp` String (optional) - Content Security Policy for the isolated world.
* `name` String (optional) - Name for isolated world. Useful in devtools.
Set the security origin, content security policy and name of the isolated world.
Note: If the `csp` is specified, then the `securityOrigin` also has to be specified.
### `webFrame.getResourceUsage()`
Returns `Object`: