prevent websocket closing with balnk target
This commit is contained in:
parent
3da148f406
commit
e6924d9912
|
@ -73,6 +73,15 @@ ws.onmessage = function (evt) {
|
||||||
else alert("Message is received:"+ received_msg);
|
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;
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -81,7 +90,7 @@ ws.onmessage = function (evt) {
|
||||||
<p id="reason"></p>
|
<p id="reason"></p>
|
||||||
<p id="amount"></p>
|
<p id="amount"></p>
|
||||||
<div style="background-color:#7777aa; border-radius: 5px; padding:10px;">
|
<div style="background-color:#7777aa; border-radius: 5px; padding:10px;">
|
||||||
<a style="color:#ffffff; text-decoration:none;" id="paylink">Pay with Bitcoin</a>
|
<a style="color:#ffffff; text-decoration:none;" id="paylink" target="_blank">Pay with Bitcoin</a>
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
<div id="qrcode" align="center"></div>
|
<div id="qrcode" align="center"></div>
|
||||||
|
|
Loading…
Reference in New Issue