Skip to content

Commit

Permalink
Updated documentation for contextIsolation
Browse files Browse the repository at this point in the history
  • Loading branch information
twolfson committed Mar 27, 2021
1 parent 5d7f29b commit eb29c4c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This was written to allow for directly testing in [Electron][] where we might wa

**Notices:**

- This plugin has been tested against `electron@0.37.4` and `electron@1.3.3` but should support the latest version
- This plugin has been tested against `electron@{0.x,1,5,6,7,8,9,11,12}` and should support the latest version
- This plugin is best suited for testing the renderer portion of an `electron` application
- For testing a full application, see `electron's` documentation on Selenium and WebDriver
- https://github.com/electron/electron/blob/v1.3.6/docs/tutorial/using-selenium-and-webdriver.md
Expand Down Expand Up @@ -172,8 +172,10 @@ module.exports = function (config) {
};
```

### Forcing `nodeIntegration` support
If we're upgrading to Electron@5 or later, then we might run into missing `nodeIntegration` support. While it's advised to use `preload`, here's a workaround until the transition to `preload` is complete
### Forcing `nodeIntegration` and `contextIsolation` support
If we're upgrading to Electron@5 or later, then we might run into missing `nodeIntegration` and `contextIsolation` support (e.g. `require is not defined`).

While it's advised to use `preload`, here's a workaround for now:

```js
module.exports = function (config) {
Expand All @@ -187,7 +189,8 @@ module.exports = function (config) {
base: 'Electron',
browserWindowOptions: {
webPreferences: {
nodeIntegration: true
nodeIntegration: true,
contextIsolation: false
}
}
}
Expand Down

0 comments on commit eb29c4c

Please sign in to comment.