Open RenegadeButcher opened 2 years ago
Based on my current experimenting, it appears it's specifically 301 redirects that work quite well to open mobile wallets, but bypass Alby even if the final URL is lightning:LNURL****. So something about a 301 redirect is blinding the webln.
Thanks for your detailed report, that really helps a lot. 👍
After investigating this for a bit I want to summarize my findings here:
bitcoin
is in there, lightning
is not)web+
(e.g. web+alby
or web+lightning
which doesn't help much in this case)browser.tabs.onUpdated
will only trigger for certain schemes (which lightning
is not a part of)location
header for lightning:
linksext+alby:...
--> Not ideal, but does the job
Submit lightning
as a proposal for official link schemes:
https://html.spec.whatwg.org/multipage/system-state.html#safelisted-scheme
That way Alby could register for lightning
links globally and handle them properly
Excellent! I appreciate your thorough research. At least now it's clear why the issue exists!
Perhaps watching headers is a simple addition in the short term until protocol and browser standards catch-up. In the meantime, I've managed some workarounds.
Thank you, again!
On Fri, Aug 26, 2022 at 5:44 AM René Aaron @.***> wrote:
Thanks for your detailed report, that really helps a lot. 👍
After investigating this for a bit I want to summarize my findings here: Extensions can register themselves as protocol handlers
- Limited to official protocol https://developer.mozilla.org/de/docs/Web/API/Navigator/registerProtocolHandler names (bitcoin is in there, lightning is not)
- If not in official protocol name you have to prefix with web+ (e.g. web+alby or web+lightning which doesn't help much in this case)
Browser APIs limit events that are exposed
- browser.tabs.onUpdated will only trigger for certain schemes (which lightning is not a part of)
Intercepting 301 redirect is possible
- Intercept all responses
- check the location header for lightning: links
- rewrite the header to ext+alby:...
- this will open a new extension page (not the extension popup)
--> Not ideal, but does the job Other ideas
Submit lightning as a proposal for official link schemes:
https://html.spec.whatwg.org/multipage/system-state.html#safelisted-scheme
That way Alby could register for lightning links globally and handle them properly
— Reply to this email directly, view it on GitHub https://github.com/getAlby/lightning-browser-extension/issues/1305#issuecomment-1228342908, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2IS4DCUY26TSG3Q2IRVF73V3CNZLANCNFSM565Z7NIA . You are receiving this because you authored the thread.Message ID: @.***>
thanks for reporting and thanks @reneaaron for the research, good to know should alby register the bitcoin: protocol handler?
I was also thinking about that. At least bitcoin:
links with the lightning
parameter could potentially be handled by Alby. (BIP21)
Registering a bitcoin:
protocol handler would probably be the cleaner way to handle bitcoin:
links for now since it allows the user to choose between different software (e.g. if they have locally installed software that is able to handle those links, too).
Right now we already handle those kind of links and local software has no chance of picking up the links.
LNURLS hyperlinked with the lightning: prefix open in Alby, but the same links forwarded in a shrt url or forwarded subdomain do not get recognized by Alby. Instead browsers attempt to call an external application.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Alby should recognize the forwarded string in the same manner as a normal hyperlink
Alby information
Alby Version: 1.13.0
Alby installed through Brave and Firefox browser stores
Wallets connected with Alby: Albyand multiple LNDhub connections to Telegram @lightningtipbot as well as LNbits wallets
Device information [optional]:
OS: Linux Mint 20.3 XFCE]
Browser: Brave [Version 1.41.100 Chromium: 103.0.5060.134 (Official Build) (64-bit)] and Firefox version 102.0.1
This seems to occur on any kind of redirect. Some sites (Wordpress) attempt to treat lightning: hyperlinks as internal links, and some (YouTube) block the link through a redirect. Redirecting in the manner described solves the issue for mobile browsers, but does not allow the use of Alby for clickable tipping links.
Are you working on this issue?
Yes and no, I'm trying to find a way to prevent or circumvent the issue.