mirror of
https://github.com/electron/electron.git
synced 2026-01-08 23:18:06 -05:00
Fix JavaScript in docs
This commit is contained in:
@@ -51,7 +51,7 @@ The creation of the `BrowserWindow` is customizable in `WebContents`'s `new-wind
|
||||
|
||||
```javascript
|
||||
mainWindow.webContents.on('new-window', (event, url, frameName, disposition, options, additionalFeatures) => {
|
||||
if (url.endsWith("modal.html")) {
|
||||
if (url.endsWith('modal.html')) {
|
||||
// open window as modal
|
||||
event.preventDefault()
|
||||
Object.assign(options, {
|
||||
@@ -61,7 +61,7 @@ mainWindow.webContents.on('new-window', (event, url, frameName, disposition, opt
|
||||
height: 100
|
||||
})
|
||||
modal = new BrowserWindow(options)
|
||||
modal.loadURL(url)
|
||||
event.newGuest = modal
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user