Merge pull request #640 from anonymlol/master

new protocol handler: stream-magnet
This commit is contained in:
Feross Aboukhadijeh
2016-06-23 18:37:53 -07:00
committed by GitHub
4 changed files with 16 additions and 3 deletions

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)
var isMagnet = typeof file === 'string' && /^magnet:/.test(file) || /^stream-magnet:/.test(file)
return isTorrentFile || isMagnet
}