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

why does webln.enable() return an object? #2596

Closed
otech47 opened this issue Jul 27, 2023 · 5 comments · Fixed by #2599
Closed

why does webln.enable() return an object? #2596

otech47 opened this issue Jul 27, 2023 · 5 comments · Fixed by #2599

Comments

@otech47
Copy link

otech47 commented Jul 27, 2023

According to this spec the enable function has a void return type

However the webln object injected by Alby has an enable function that does not adhere to this spec so it seems some app devs have assumed that enable may return an object with enabled: true or isEnabled: true

Seems this creates confusion for WebLN providers since enable() could be implemented in inconsistent ways

Cross-posting this in more than one place (BoltzExchange/boltz-web-app#229) since I'm not sure what the best approach to fix this is... implementations are either building on an outdated spec or they are not compliant with a spec that cannot be enforced 🤔

any suggestions on what to do here?

@reneaaron
Copy link
Contributor

Thanks for bringing this up. Since enable() throws an exception when a user declines the prompt (like any other method in WebLN) I think we should change our implementation here to not return anything. I've prepared a PR for that.

However that might break some existing applications out there 🤔 Did you notice any other services that use those parameters?

@otech47
Copy link
Author

otech47 commented Jul 28, 2023

Thanks for bringing this up. Since enable() throws an exception when a user declines the prompt (like any other method in WebLN) I think we should change our implementation here to not return anything. I've prepared a PR for that.

However that might break some existing applications out there 🤔 Did you notice any other services that use those parameters?

i will do my best to hunt them down and help patch.. asking around here

@otech47
Copy link
Author

otech47 commented Jul 29, 2023

going through bolt.fun for LN enabled apps and compiling a list of patches for any apps that would break

May need patch

No patch needed

Does not use webln.enable()

Uses webln.enable() properly

@otech47
Copy link
Author

otech47 commented Jul 29, 2023

cant find source code for Kollider browser extension... I checked kollider-lite-app and it seems unaffected by this

tagging a few contributors maybe we can find out if @kolliderhq should patch too at least on the browser extension side...

@fl-y @the-kollider @mk-kollider

@bumi
Copy link
Collaborator

bumi commented Aug 12, 2023

thank you @otech47. This is some old old thing (it got falsely added in the first commit even)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants