Fixes for PR #640

This commit is contained in:
Feross Aboukhadijeh
2016-06-23 18:57:08 -07:00
parent b2d2a6a7a5
commit 4799a032e5
2 changed files with 2 additions and 1 deletions

View File

@@ -36,6 +36,7 @@ function installDarwin () {
// On OS X, only protocols that are listed in `Info.plist` can be set as the
// default handler at runtime.
app.setAsDefaultProtocolClient('magnet')
app.setAsDefaultProtocolClient('stream-magnet')
// File handlers are defined in `Info.plist`.

View File

@@ -570,7 +570,7 @@ function onOpen (files) {
function isTorrent (file) {
var name = typeof file === 'string' ? file : file.name
var isTorrentFile = path.extname(name).toLowerCase() === '.torrent'
var isMagnet = typeof file === 'string' && /^magnet:/.test(file) || /^stream-magnet:/.test(file)
var isMagnet = typeof file === 'string' && /^(stream-)?magnet:/.test(file)
return isTorrentFile || isMagnet
}