Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: lnurl scheme parsing #2975

Merged
merged 3 commits into from
Jan 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/extension/inpage-script/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ function registerLightningLinkClickHandler() {
return;
}
const lightningLink = target.closest('[href^="lightning:" i]');
const lnurlLink = target.closest('[href^="lnurl" i]');
const lnurlLink = target.closest(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we link to the relevant spec? I think it is LUD-17

Copy link
Contributor

@rolznz rolznz Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we support keyauth too? (I think this change will currently break it)

Copy link
Author

@ekzyis ekzyis Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we link to the relevant spec? I think it is LUD-17

Done in 385af36

Should we support keyauth too? (I think this change will currently break it)

I think you never supported keyauth so this change will not break it. I searched for keyauth in your source code and no occurrence was found:

$ grep -R "keyauth" src/

I have never seen keyauth in the wild and LNURL-auth already works with Alby. So I think this is a part of a spec that isn't necessary to implement. But might still make sense to add it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, thanks! I'll made a new issue for that: #2984

'[href^="lnurlp:" i],[href^="lnurlw:" i],[href^="lnurlc:" i]'
);
const bitcoinLinkWithLighting = target.closest(
'[href*="lightning=ln" i]'
); // links with a lightning parameter and a value that starts with ln: payment requests (lnbc...) or lnurl (lnurl*)
); // links with a lightning parameter and a value that starts with ln: payment requests (lnbc...) or lnurl (lnurl[pwc]:)
pavanjoshi914 marked this conversation as resolved.
Show resolved Hide resolved
let href;
let paymentRequest;
let lnurl;
Expand Down