mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -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
|
```javascript
|
||||||
mainWindow.webContents.on('new-window', (event, url, frameName, disposition, options, additionalFeatures) => {
|
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
|
// open window as modal
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
Object.assign(options, {
|
Object.assign(options, {
|
||||||
@@ -61,7 +61,7 @@ mainWindow.webContents.on('new-window', (event, url, frameName, disposition, opt
|
|||||||
height: 100
|
height: 100
|
||||||
})
|
})
|
||||||
modal = new BrowserWindow(options)
|
modal = new BrowserWindow(options)
|
||||||
modal.loadURL(url)
|
|
||||||
event.newGuest = modal
|
event.newGuest = modal
|
||||||
}
|
}
|
||||||
|
})
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user