mastodon-simplified-federation
mastodon-simplified-federation copied to clipboard
Support auto-redirection by `<link>`
Fixes #105
For now I didn't touch the existing detection mechanism. It could also detect more pages by some heuristic with regex on page URLs, but I'll defer that part.
Technically it could be faster with direct request redirection by reading HTTP headers, but:
- That would require webRequestBlocking and would block #55
- Misskey do not support headers but only HTML elements
- Blocking all requests sounds very bad for general browser performance
BTW, I wonder what's the best to do when one wants to see the original page without redirection (because the fetched page in the home server may not show the full information). I'm deferring that too 👀
(This needs tests)
Hi @saschanaz, first of all, thanks for your first contribution to this project! :tada: :+1: 🏅 I hope you'll like this project and enjoy hacking on it… :smiley:
I am really sorry about the late reply, but I am quite busy with other life stuff and my GitHub backlog is growing exponentially.
Anyway, thanks a lot for that contribution (and idea BTW). I have created a milestone for that feature as it would change the UX of this add-on completely/drastically, but in a good way IMHO.
I am answering the questions here now here:
- Use the injection code to add "open it in my home server" button (perhaps with a home icon) for some supported server implementations (so that one can see some extra info in the original page)
- If not, add a position: absolute fallback popup with the same button on the top of the page
I can imagine both being useful. But a popup may actually be the coolest thing – maybe in the design of that "copy that link" popup Mastodon shows by default, so that would be a replacement for it and integrate more seemingly.
However, I have another idea:
- What about saving the lastest redirected URL/toot/user, and – if that URL is opened again only then show that popup aka „Do you really want to redirect?“. In other words: Only redirect if the toot has not been recently redirected already. This would save the click in 80% of the cases while keeping the ability to see the original toot when you have a reason for that.
If you wanted a quick implementation/MVP of it, you could just treat it as „no i never want to redirect if the URL is opened again” and not implement the popup for now. Then you could test how it feels like when using and maybe we don't actually need a popup?
I could imagine this would be a quite intuitive way, or otherwise one cannot differentiate that that may be an error? I don't know whether and how we could communicate that, if so, but we could always make it an optional feature to be enabled in the settings.