Skip to content

Commit

Permalink
Register Atom to handle atom:// scheme URLs.
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Jul 10, 2013
1 parent 0fee962 commit 753b11c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions resources/mac/atom-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@
<string>speakeasy.pem</string>
<key>SUScheduledCheckInterval</key>
<string>3600</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>atom</string>
</array>
<key>CFBundleURLName</key>
<string>Atom Shared Session Protocol</string>
</dict>
</array>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
Expand Down
8 changes: 8 additions & 0 deletions src/main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ fs = require 'fs'
path = require 'path'
optimist = require 'optimist'
nslog = require 'nslog'
dialog = require 'dialog'
_ = require 'underscore'

console.log = (args...) ->
Expand All @@ -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', ->
Expand Down

0 comments on commit 753b11c

Please sign in to comment.