diff --git a/README.md b/README.md index 2cbe575..19cbd0b 100755 --- a/README.md +++ b/README.md @@ -6,6 +6,9 @@ When users click right on a magnet link, there will be an option in the browser' ![setting](setting_page.png) ### Releases +**version: 1.6b** +* Now url links can also be added as magnet, solving [Issue#2](/~https://github.com/ketankr9/cloud-torrent-extension/issues/2) + **version: 1.5b** * Click on a magnet and it will be sent to the cloud torrent. Used protocol_handlers for handling magnets. diff --git a/cloud_torrent_magnet-1.5b-fx.xpi b/cloud_torrent_magnet-1.5b-fx.xpi deleted file mode 100644 index b2c0b55..0000000 Binary files a/cloud_torrent_magnet-1.5b-fx.xpi and /dev/null differ diff --git a/magnet-extension/background.js b/magnet-extension/background.js index 82512a6..8da9505 100755 --- a/magnet-extension/background.js +++ b/magnet-extension/background.js @@ -15,7 +15,15 @@ browser.menus.create({ function MakeXhrRequest(magnetContent, serverip){ var xhr = new XMLHttpRequest(); - xhr.open("POST", 'http://'+serverip+'/api/magnet', true); + + var URL = 'http://'+serverip + '/api/'; + + if(magnetContent.slice(0,6) === 'magnet') + URL += 'magnet'; + else + URL += 'url'; + + xhr.open("POST", URL, true); //Include browser based Cookie header and Authorization header(if set) xhr.withCredentials = true; diff --git a/magnet-extension/manifest.json b/magnet-extension/manifest.json index 2b2c0fb..b8fe8d0 100755 --- a/magnet-extension/manifest.json +++ b/magnet-extension/manifest.json @@ -3,7 +3,7 @@ "manifest_version": 2, "name": "Cloud-Torrent-Magnet", "description": "Send Magnet to Cloud-Torrent Server", - "version": "1.5b", + "version": "1.6b", "applications": { "gecko": { "strict_min_version": "57.0"