Skip to content

Instantly share code, notes, and snippets.

@SamSamskies
Created August 17, 2024 02:19
Show Gist options
  • Save SamSamskies/f0c8c9ac58db3c52d2fbc8f1a9d06b2e to your computer and use it in GitHub Desktop.
Save SamSamskies/f0c8c9ac58db3c52d2fbc8f1a9d06b2e to your computer and use it in GitHub Desktop.
Override WebLN sendPayment bookmarket
javascript:(function(){window.webln.sendPayment=(invoice)=>fetch(`https://api.qrserver.com/v1/create-qr-code/?data=${invoice}&size=400x400&margin=15`).then(response=>response.blob()).then(blob=>{const qrCodeUrl=URL.createObjectURL(blob);const modal=document.createElement('div');modal.style.position='fixed';modal.style.top='0';modal.style.left='0';modal.style.width='100%';modal.style.height='100%';modal.style.background='rgba(0, 0, 0, 0.5)';modal.style.display='flex';modal.style.justifyContent='center';modal.style.alignItems='center';const img=document.createElement('img');img.src=qrCodeUrl;img.style.width='400px';img.style.height='400px';modal.appendChild(img);document.body.appendChild(modal);modal.onclick=()=>{modal.remove();};});})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment