Fix opening links in external browsers.

This commit is contained in:
Cheng Zhao 2013-05-23 14:50:21 +08:00
parent 8849eb1186
commit f715a6fca2
2 changed files with 3 additions and 3 deletions

View File

@ -216,12 +216,12 @@ describe "Window", ->
$("<a href='http://github.com'>the website</a>").appendTo(document.body).click().remove()
expect(shell.openExternal).toHaveBeenCalled()
expect(shell.openExternal.argsForCall[0]).toBe "http://github.com"
expect(shell.openExternal.argsForCall[0][0]).toBe "http://github.com"
shell.openExternal.reset()
$("<a href='https://github.com'>the website</a>").appendTo(document.body).click().remove()
expect(shell.openExternal).toHaveBeenCalled()
expect(shell.openExternal.argsForCall[0]).toBe "https://github.com"
expect(shell.openExternal.argsForCall[0][0]).toBe "https://github.com"
shell.openExternal.reset()
$("<a href=''>the website</a>").appendTo(document.body).click().remove()

View File

@ -36,7 +36,7 @@ class WindowEventHandler
return if location[0] is '#'
if location.indexOf('https://') is 0 or location.indexOf('http://') is 0
require('child_process').spawn('open', [location])
require('shell').openExternal location
false
eachTabIndexedElement: (callback) ->