refactor: make shell.OpenExternal async (#17135)

This commit is contained in:
Shelley Vohr 2019-05-03 13:53:45 -07:00 committed by GitHub
parent 0755857a0c
commit 6d96f30ed3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 70 additions and 140 deletions

View file

@ -47,4 +47,4 @@ Take a look at 5.0.0 Timeline [blog post](https://electronjs.org/blog/electron-5
| Tue, 2019-Jul-30 | 6.0.0 | ✨ stable ✨ |
## 7.0.0 Release Schedule
TBD
TBD

View file

@ -681,12 +681,12 @@ windows, limiting it to only what you need.
const { shell } = require('electron')
app.on('web-contents-created', (event, contents) => {
contents.on('new-window', (event, navigationUrl) => {
contents.on('new-window', async (event, navigationUrl) => {
// In this example, we'll ask the operating system
// to open this event's url in the default browser.
event.preventDefault()
shell.openExternalSync(navigationUrl)
await shell.openExternal(navigationUrl)
})
})
```