Skip to content

Commit

Permalink
update menu and misc
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Dec 22, 2018
1 parent 5753a72 commit c6b798e
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions default_app/menu.js
Expand Up @@ -77,27 +77,27 @@ 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`
)
}
},
{
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')
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion default_app/renderer.js
Expand Up @@ -19,7 +19,7 @@ function initialize () {

const openLinkExternally = (e) => {
e.preventDefault()
shell.openExternal(url)
shell.openExternalSync(url)
}

link.addEventListener('click', openLinkExternally)
Expand Down
2 changes: 1 addition & 1 deletion docs/api/menu.md
Expand Up @@ -198,7 +198,7 @@ const template = [
submenu: [
{
label: 'Learn More',
click () { require('electron').shell.openExternal('https://electronjs.org') }
click () { require('electron').shell.openExternalSync('https://electronjs.org') }
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion docs/api/webview-tag.md
Expand Up @@ -782,7 +782,7 @@ const webview = document.querySelector('webview')
webview.addEventListener('new-window', (e) => {
const protocol = require('url').parse(e.url).protocol
if (protocol === 'http:' || protocol === 'https:') {
shell.openExternal(e.url)
shell.openExternalSync(e.url)
}
})
```
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/security.md
Expand Up @@ -639,7 +639,7 @@ app.on('web-contents-created', (event, contents) => {
// to open this event's url in the default browser.
event.preventDefault()

shell.openExternal(navigationUrl)
shell.openExternalSync(navigationUrl)
})
})
```
Expand Down
2 changes: 1 addition & 1 deletion spec/api-remote-spec.js
Expand Up @@ -184,7 +184,7 @@ describe('remote module', () => {
assert.strictEqual(typeof remote.app.getPath, 'function')
assert.strictEqual(typeof remote.webContents.getFocusedWebContents, 'function')
assert.strictEqual(typeof remote.clipboard.readText, 'function')
assert.strictEqual(typeof remote.shell.openExternal, 'function')
assert.strictEqual(typeof remote.shell.openExternalSync, 'function')
})

it('returns toString() of original function via toString()', () => {
Expand Down
2 changes: 1 addition & 1 deletion spec/api-shell-spec.js
Expand Up @@ -35,14 +35,14 @@ describe('shell module', () => {
if (process.platform !== 'linux') this.skip()

process.env.DE = 'generic'
process.env.DISPLAY = ''
const tests = [
{ BROWSER: '/bin/true', expected: true },
{ BROWSER: '/bin/false', expected: false }
]

for (const test of tests) {
const { BROWSER, expected } = test
process.env.DISPLAY = ''
process.env.BROWSER = BROWSER
const actual = shell.openExternalSync('http://www.example.com')
assert.strictEqual(expected, actual)
Expand Down

0 comments on commit c6b798e

Please sign in to comment.