Register Atom to handle atom:// scheme URLs.

This commit is contained in:
Cheng Zhao
2013-07-10 18:57:26 +08:00
parent 0fee962faa
commit 753b11cf15
2 changed files with 19 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ fs = require 'fs'
path = require 'path'
optimist = require 'optimist'
nslog = require 'nslog'
dialog = require 'dialog'
_ = require 'underscore'
console.log = (args...) ->
@@ -21,6 +22,13 @@ delegate.browserMainParts.preMainMessageLoopRun = ->
event.preventDefault()
args.pathsToOpen.push(filePath)
app.on 'open-url', (event, url) =>
event.preventDefault()
dialog.showMessageBox
message: 'Atom opened with URL'
detail: url
buttons: ['OK']
app.on 'open-file', addPathToOpen
app.on 'will-finish-launching', ->