diff --git a/main/handlers.js b/main/handlers.js index 5ea9431a28..454871a2a5 100644 --- a/main/handlers.js +++ b/main/handlers.js @@ -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`. diff --git a/renderer/main.js b/renderer/main.js index aa357c2a6b..e34cb51229 100644 --- a/renderer/main.js +++ b/renderer/main.js @@ -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 }