feat: expose executeJavaScriptInIsolatedWorld on webContents (#21190)
* feat: expose executeJavaScriptInIsolatedWorld on webContents * Apply suggestions from code review Co-Authored-By: loc <andy@slack-corp.com>
This commit is contained in:
parent
a7c2f79a94
commit
34452ee69e
3 changed files with 43 additions and 12 deletions
|
@ -1031,6 +1031,17 @@ contents.executeJavaScript('fetch("https://jsonplaceholder.typicode.com/users/1"
|
|||
})
|
||||
```
|
||||
|
||||
#### `contents.executeJavaScriptInIsolatedWorld(worldId, scripts[, userGesture])`
|
||||
|
||||
* `worldId` Integer - The ID of the world to run the javascript in, `0` is the default world, `999` is the world used by Electron's `contextIsolation` feature. You can provide any integer here.
|
||||
* `scripts` [WebSource[]](structures/web-source.md)
|
||||
* `userGesture` Boolean (optional) - Default is `false`.
|
||||
|
||||
Returns `Promise<any>` - A promise that resolves with the result of the executed code
|
||||
or is rejected if the result of the code is a rejected promise.
|
||||
|
||||
Works like `executeJavaScript` but evaluates `scripts` in an isolated context.
|
||||
|
||||
#### `contents.setIgnoreMenuShortcuts(ignore)` _Experimental_
|
||||
|
||||
* `ignore` Boolean
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue