feat: split openExternal into sync and async (#16176)
* feat: split openExternal into sync and async * v8::Locker => mate::Locker * fix: enter js env when resolving promise
This commit is contained in:
parent
52e257668d
commit
0881fd6397
11 changed files with 135 additions and 55 deletions
|
@ -13,13 +13,13 @@ const setDefaultApplicationMenu = () => {
|
|||
{
|
||||
label: 'Learn More',
|
||||
click () {
|
||||
shell.openExternal('https://electronjs.org')
|
||||
shell.openExternalSync('https://electronjs.org')
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'Documentation',
|
||||
click () {
|
||||
shell.openExternal(
|
||||
shell.openExternalSync(
|
||||
`https://github.com/electron/electron/tree/v${process.versions.electron}/docs#readme`
|
||||
)
|
||||
}
|
||||
|
@ -27,13 +27,13 @@ const setDefaultApplicationMenu = () => {
|
|||
{
|
||||
label: 'Community Discussions',
|
||||
click () {
|
||||
shell.openExternal('https://discuss.atom.io/c/electron')
|
||||
shell.openExternalSync('https://discuss.atom.io/c/electron')
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'Search Issues',
|
||||
click () {
|
||||
shell.openExternal('https://github.com/electron/electron/issues')
|
||||
shell.openExternalSync('https://github.com/electron/electron/issues')
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
@ -21,7 +21,7 @@ function initialize () {
|
|||
|
||||
const openLinkExternally = (e) => {
|
||||
e.preventDefault()
|
||||
shell.openExternal(url)
|
||||
shell.openExternalSync(url)
|
||||
}
|
||||
|
||||
link.addEventListener('click', openLinkExternally)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue