From e6924d991254d0a7e6c5fb84e14241081123507a Mon Sep 17 00:00:00 2001 From: ThomasV Date: Fri, 24 Jul 2015 13:30:51 +0200 Subject: [PATCH] prevent websocket closing with balnk target --- lib/www/index.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/www/index.html b/lib/www/index.html index e041c425..b18500bd 100644 --- a/lib/www/index.html +++ b/lib/www/index.html @@ -73,6 +73,15 @@ ws.onmessage = function (evt) { else alert("Message is received:"+ received_msg); }; + +// See http://stackoverflow.com/questions/29186154/chrome-clicking-mailto-links-closes-websocket-connection +$(document).on('click', 'a[href^="bitcoin:"]', function (e) { + e.preventDefault(); + var btcWindow = window.open($(e.currentTarget).attr('href')); + btcWindow.close(); + return false; +}); + @@ -81,7 +90,7 @@ ws.onmessage = function (evt) {

- Pay with Bitcoin + Pay with Bitcoin