OdyseeTeam / odysee-ios

The Odysee iOS app with wallet functionality.
MIT License
67 stars 21 forks source link

support direct lbry:// URL linking #217

Open tzarebczan opened 3 years ago

tzarebczan commented 3 years ago

For whatever reason @ symbols are stripped when trying to paste in to the safari workaround

This should even work for blacklisted words like covid

ktprograms commented 2 years ago

The problem seems to stem from the fact that the lbry:// URI format is not acceptable as a URI, so browsers don't seem to handle it properly.

Working with an example LBRY URI of lbry://@Odysee:8/Odysee-Android-App:1, we can see the following violations of the standard (looking at https://en.wikipedia.org/wiki/URL#Syntax)

There is the start of an authority component, which is meant for userinfo+host+port, but is being used as:

This gets parsed as the following by browsers: Browser Result
Safari on iOS Simulator lbry://odysee:8/Odysee-Android-App:1
Safari on macOS lbry://Odysee:8/Odysee-Android-App:1
Firefox (on macOS) lbry://@Odysee:8/Odysee-Android-App:1 - This is the only one that shows the original URL
Qutebrowser (QTWebEngine aka Chromium) on Linux lbry://@odysee:8/Odysee-Android-App:1 - Note the lowercase host, as is the standard for a hostname
Epiphany (WebKitGTK, same engine as Safari) on Linux lbry://Odysee:8/Odysee-Android-App:1

Using lbry:@Odysee:8/Odysee-Android-App:1 works correctly on all browsers (except that the LBRY/Odysee apps can't handle this format), as URIs without an authority can have any characters in any order.

tzarebczan commented 2 years ago

The issue probably wasn't clear enough, sorry. Want to be able to post these urls with and without Lbry:// into the search bar in the app, and go directly to the claim (vs running a search). Not sure if there's a nice way to detect via regex, and it could lead to a direct link when someone was intending to search, but if the regexes are specific enough , maybe it won't happen too often. Probably need to replace # with : also, so both work.

I..e @channel:1 / @channel#1 @channel:1/claim:2 / @channel#1/claim#2 Claim:2 / claim#2 (probably the biggest chance for false match).

Can leave this one for now , not super important.

ktprograms commented 2 years ago

Ok, although it's worth noting that LBRY URIs aren't really spec conforming.

robster7674 commented 1 year ago

Somewhat related: https://github.com/OdyseeTeam/odysee-ios/issues/277#issuecomment-1229199510.