Tusky icon indicating copy to clipboard operation
Tusky copied to clipboard

Add Mastodon Redirect support

Open zacharee opened this issue 1 year ago • 9 comments

Mastodon Redirect is my app that handles redirecting Mastodon links to supported apps, so the apps don't have to maintain their own list of supported instances.

This PR adds auto-detect support for Mastodon Redirect, so Tusky can be chosen for opening Mastodon links.

Addresses https://github.com/tuskyapp/Tusky/issues/3865

To test:

  1. Download Mastodon Redirect from https://github.com/zacharee/MastodonRedirect.
  2. Install Tusky from this PR's code.
  3. Open and log into Tusky.
  4. Find a random post and copy its link. Paste the link somewhere it'll be clickable, such as in Telegram's "Saved messages" channel.
  5. Remove Tusky from Recents.
  6. Open Mastodon Redirect and select Tusky in the "Discovered" section.
  7. Tap the pasted link. It should launch Tusky and then resolve to the post.
  8. Back out to the main feed in Tusky and go back to the link, without removing Tusky from Recents this time. The link should open Tusky and resolve to the post.

zacharee avatar Dec 26 '23 16:12 zacharee

I fail to test that. My steps:

  • use an Android Api 34 emulator
  • Install Tusky from this branch
  • Install Mastodon redirect 1.11.0
  • make Android open links from a few domains with Mastodon redirect
  • enable Tusky in Mastodon redirect
  • click a link from one of the enabled domains in Chrome
  • Chrome closes
Failed to deliver inset control state change to w=Window{bb5153c u0 com.android.chrome/com.google.android.apps.chrome.Main EXITING}
android.os.DeadObjectException

similar result on a real device and with Firefox

connyduck avatar Jan 01 '24 19:01 connyduck

Try using the "Open Link" share target instead.

Mastodon Redirect has so many domains that it can break whatever API Chrome is using to read where to open links. I've been waiting on an update to instances.social's API for better active-status filtering.

zacharee avatar Jan 01 '24 20:01 zacharee

Same result with "open link" :( Seems like Android is unable to cope with an app having so many supported domains

connyduck avatar Jan 02 '24 18:01 connyduck

Try revoking any links you enabled for auto-handling. You might also need to try opening a link from something like Keep or Telegram. I want to reduce the number of handled domains in Mastodon Redirect, but I haven't been able to find a better source yet.

zacharee avatar Jan 02 '24 18:01 zacharee

I've reduced the number of supported domains by about 1000 in Mastodon Redirect. It's still over 11k total, but it should be less prone to crashing.

zacharee avatar Jan 05 '24 00:01 zacharee

I also added a new share target for opening links, which uses the same path Mastodon Redirect does.

zacharee avatar Jan 18 '24 04:01 zacharee

Any news here? 🙈

tiptoptom avatar Mar 20 '24 17:03 tiptoptom

@zacharee This PR needs to be rebased or have a merge commit from tuskyapp:develop. If you can not afford time for solving this, I can gladly take over. (no tusky maintainer, just want to help getting this done :) )

Lazalatin avatar May 12 '24 20:05 Lazalatin

@lazalatin can you bring that forward?

tiptoptom avatar Aug 12 '24 06:08 tiptoptom