refactor: make shell.OpenExternal async (#17135)
This commit is contained in:
parent
0755857a0c
commit
6d96f30ed3
16 changed files with 70 additions and 140 deletions
|
@ -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)
|
||||
})
|
||||
})
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue