From c4a74c526d26e65d4f2bc4a005548fa23cf6e843 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sun, 20 Mar 2016 01:31:11 -0700 Subject: [PATCH] tweak registerProtocolHandler API --- main/register-protocol-handler.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/main/register-protocol-handler.js b/main/register-protocol-handler.js index 9b46f6b1..88e7cf5b 100644 --- a/main/register-protocol-handler.js +++ b/main/register-protocol-handler.js @@ -2,7 +2,7 @@ var config = require('../config') module.exports = function () { if (process.platform === 'win32') { - registerProtocolHandler('magnet', 'BitTorrent Magnet URL', config.APP_FILE_ICON + '.ico', process.execPath) + registerProtocolHandler('magnet', 'URL:BitTorrent Magnet URL', config.APP_FILE_ICON + '.ico', process.execPath) registerFileHandler('.torrent', 'io.webtorrent.torrent', 'BitTorrent Document', config.APP_FILE_ICON + '.ico', process.execPath) } } @@ -12,13 +12,15 @@ module.exports = function () { * registry: * * HKEY_CLASSES_ROOT - * $PROTOCOL - * (Default) = "URL:$NAME" - * URL Protocol = "" - * shell - * open - * command - * (Default) = "$COMMAND" "%1" + * $PROTOCOL + * (Default) = "$NAME" + * URL Protocol = "" + * DefaultIcon + * (Default) = "$ICON" + * shell + * open + * command + * (Default) = "$COMMAND" "%1" * * Source: https://msdn.microsoft.com/en-us/library/aa767914.aspx * @@ -34,7 +36,7 @@ function registerProtocolHandler (protocol, name, icon, command) { hive: Registry.HKCU, // HKEY_CURRENT_USER key: '\\Software\\Classes\\' + protocol }) - protocolKey.set('', Registry.REG_SZ, 'URL:' + name, callback) + protocolKey.set('', Registry.REG_SZ, name, callback) protocolKey.set('URL Protocol', Registry.REG_SZ, '', callback) var iconKey = new Registry({