Join GitHub today
Add context menu item for selected bolt11 payment requests #108
Added a context menu item to "Pay Lightning Invoice" when a BOLT-11 payment request string is highlighted on the page and right-clicked. When this menu item is clicked, the payment popup is displayed allowing you to confirm the payment. The extension makes an effort to only show the menu item when a valid payment request is highlighted
Steps to Test
referenced this pull request
Dec 22, 2018
This is a really clever work-around for the extension API's lack of a way to show conditionally based on the content highlighted. I had hoped it'd work even without highlighting the BOLT-11 string, just by reading the content of the element, but it doesn't look like there's a straightforward way to do that. I'm going to dig in a little bit and see if that can be done, but if not, I'll merge this in.
Thanks for the contribution!
I had not even considered the case where the user right-clicks without highlighting first, but that’s even better than what i have so far. I think it is may be possible if the mousedown event captures the associated DOM element. Then it’s just a matter of navigating up to the parent tag and getting the innerText. I will try this tomorrow and let you know how i make out.