191
submitted 1 year ago* (last edited 1 year ago) by XpeeN@sopuli.xyz to c/youshouldknow@lemmy.world

This script transforms links from other instances to your home instance. So useful :)

As @MedicareForSome@lemmy.ml explained:

It makes it so that if you visit another instance using their URL, it will redirect you to your home version’s federated link.

E.g. if your home server is Lemmy.world, let’s say you find a link to Lemmy on another website but it’s a link to Lemmy.ml. If you click the link, you won’t be signed in.

So like: https://lemmy.ml/c/memes would redirect to https://lemmy.world/c/memes@lemmy.ml

This way you can seamlessly use Lemmy.

It does the same for posts.

Edit: since it works from any site, I highly recommend you to add it to your Android browser so it will work with webapp clients here's how:

You can use violentMonkey on ff browser too, but you need to unlock Dev options, then do this

top 47 comments
sorted by: hot top controversial new old
[-] Azzu@lemm.ee 17 points 1 year ago* (last edited 1 year ago)

Author here, any questions or issues can be directed to me :)

And yes, I'm doing it for the luls

[-] XpeeN@sopuli.xyz 4 points 1 year ago

Tnx for your great work!

[-] icesentry@lemmy.world 1 points 1 year ago

How does it detect that a link is a lemmy link? Also, does this work on any website or just lemmy? Can it also handle things like opening a link from an app outside of the browser?

[-] Azzu@lemm.ee 3 points 1 year ago* (last edited 1 year ago)

You should look at the link this post points to, the description of the script answers 2/3 :D

  1. A link is detected by keeping a list of all instances and just matching them to that list. Currently contains 1188 instances from https://lemmyverse.net/?order=active
  2. Yes, any website
  3. Yes, not immediately, but you get a "Show on [HOME INSTANCE]" link at the top

[-] XpeeN@sopuli.xyz 2 points 1 year ago
[-] Azzu@lemm.ee 2 points 1 year ago

It basically just asks your home server.

How do we get this into lemour?

[-] Azzu@lemm.ee 1 points 1 year ago

I don't know what that is and I can't seem to find any relevant information doing a web search

Oh yeah sorry it's called Jebora

[-] Azzu@lemm.ee 4 points 1 year ago

I see. I think there are already efforts towards that. This is mainly supposed to be for the browser and not my domain.

And honestly, I don't really get why you'd need an app if the official web UI works perfectly well on a mobile browser :)

  • Better push notifications
  • smaller scope for browser storage permission
  • smoother (and more) animations
  • better multi account support

I think there are even more reasons.

This is mainly supposed to be for the browser and not my domain.

What do you mean? I wanted it in an app, not domain spicific.

[-] Azzu@lemm.ee 2 points 1 year ago

You're in a thread about me answering questions for a browser extension, asking about a mobile app. I think it's more appropriate to ask: what do you mean? I have nothing to do with a mobile app.

But its obviously a great functionality. We could think of setting it up as a proper library with good interfaces so you could just pull it into your code.

In the end we are making open source software to improve the platform, so you could also submit your algorithm to the projects.

I'm sorry I thought this thread is about asking questions and having a discussion about the feature and your code

[-] Azzu@lemm.ee 3 points 1 year ago* (last edited 1 year ago)

The native Jerboa app does not use any JavaScript. The code is not and can not be compatible. The "algorithm" I use is like 10 lines of code, I wrote the base of it in like 1 hour. Most of the rest of the code is solely about handling the weirdness of browsers and having it work in all kinds of different websites, all of which jerboa wouldn't care about.

I could probably implement the feature in jerboa in 3-4 hours, depending on how easy it is to get into the Android app ecosystem. But I don't use jerboa and don't care much about it, so I won't, unless somebody wants to pay me which I don't think is happening.

If you had made this comment from the start, I could have responded like I did now. As it were, I saw someone talking about some random app I didn't care about. I didn't have the context that was in your head, that you only now supplied in this comment.

[-] loudWaterEnjoyer@lemmy.dbzer0.com -4 points 1 year ago

Yes don't get me wrong, like its a cool feature, but I am very well aware that it's neither complex nor a lot of work, but it has to start somewhere. I was just trying to encourage pushing good features to the whole platform. But I got you, you internalized the idea behind FOSS, decentralized digital infrastructure structure owned by people not big corp, you want to be paid for your 10 line "algorithm".It's OK.

[-] Azzu@lemm.ee 2 points 1 year ago* (last edited 1 year ago)

lol, why don't you do it then?

I will most probably do that. I also thought about hitting your repository with a merge request and more optimized code.

[-] Azzu@lemm.ee 1 points 1 year ago

Sounds good :)

[-] XpeeN@sopuli.xyz 1 points 1 year ago

Yeah, I just wish sopuli's webapp wouldn't crash on me immediately. It's just feels a bit different when not full screened ^^

[-] Azzu@lemm.ee 1 points 1 year ago

That's weird, what browser do you have? I use Firefox for Android and everything is full screen and no crashes.

[-] XpeeN@sopuli.xyz 1 points 1 year ago

Mull. Other instances' webapps works fine as I stated here. Maybe the admin editted something that broke it? Idk

[-] Azzu@lemm.ee 1 points 1 year ago

No website should ever crash a browser. It could be some weird things happening on sopuli.xyz but I would take this up with the browser developer, it looks more like a fault of the browser than the website, especially as everything works in other browsers.

[-] XpeeN@sopuli.xyz 1 points 1 year ago

It seems logical, but I tried it on few browsers (some isolated on my work account so cookies make no difference), all ff based though. All crashed only with sopuli, which I find really weird, because sopuli should be using the same software as anyone else. Maybe it's the webview itself? (Using Mulch wv, although I'm not sure if mull using it) that'll explain why it happens on both fennec and Mull, but not why only sopuli lol.

If we already talking, do you mind checking (on whatever browser you're using) if it crashes for you too?

[-] Azzu@lemm.ee 2 points 1 year ago

Crashes for me, too:

Second failure launching org.mozilla.firefox/org.mozilla.fenix.customtabs.ExternalAppBrowserActivity, giving up
android.os.TransactionTooLargeException: data parcel size 614820 bytes
	at android.os.BinderProxy.transactNative(Native Method)
	at android.os.BinderProxy.transact(BinderProxy.java:571)
	at android.app.IApplicationThread$Stub$Proxy.scheduleTransaction(IApplicationThread.java:2746)
	at android.app.servertransaction.ClientTransaction.schedule(ClientTransaction.java:136)
	at com.android.server.wm.ClientLifecycleManager.scheduleTransaction(ClientLifecycleManager.java:47)
	at com.android.server.wm.ActivityTaskSupervisor.realStartActivityLocked(ActivityTaskSupervisor.java:880)
	at com.android.server.wm.RootWindowContainer.startActivityForAttachedApplicationIfNeeded(RootWindowContainer.java:2000)
	at com.android.server.wm.RootWindowContainer.$r8$lambda$auelgeOhCvbItmS_07q5VFEb1ac(Unknown Source:0)
	at com.android.server.wm.RootWindowContainer$$ExternalSyntheticLambda2.apply(Unknown Source:8)
	at com.android.internal.util.function.pooled.PooledLambdaImpl.doInvoke(PooledLambdaImpl.java:318)
	at com.android.internal.util.function.pooled.PooledLambdaImpl.invoke(PooledLambdaImpl.java:204)
	at com.android.internal.util.function.pooled.OmniFunction.apply(OmniFunction.java:78)
	at com.android.server.wm.ActivityRecord.forAllActivities(ActivityRecord.java:4270)
	at com.android.server.wm.WindowContainer.forAllActivities(WindowContainer.java:1430)
	at com.android.server.wm.WindowContainer.forAllActivities(WindowContainer.java:1423)
	at com.android.server.wm.RootWindowContainer.lambda$attachApplication$15$RootWindowContainer(RootWindowContainer.java:1978)
	at com.android.server.wm.RootWindowContainer$$ExternalSyntheticLambda20.accept(Unknown Source:6)
	at com.android.server.wm.Task.forAllRootTasks(Task.java:3197)
	at com.android.server.wm.WindowContainer.forAllRootTasks(WindowContainer.java:1806)
	at com.android.server.wm.WindowContainer.forAllRootTasks(WindowContainer.java:1806)
	at com.android.server.wm.WindowContainer.forAllRootTasks(WindowContainer.java:1806)
	at com.android.server.wm.WindowContainer.forAllRootTasks(WindowContainer.java:1806)
	at com.android.server.wm.WindowContainer.forAllRootTasks(WindowContainer.java:1806)
	at com.android.server.wm.WindowContainer.forAllRootTasks(WindowContainer.java:1806)
	at com.android.server.wm.WindowContainer.forAllRootTasks(WindowContainer.java:1799)
	at com.android.server.wm.RootWindowContainer.attachApplication(RootWindowContainer.java:1964)
	at com.android.server.wm.ActivityTaskManagerService$LocalService.attachApplication(ActivityTaskManagerService.java:6041)
	at com.android.server.am.ActivityManagerService.attachApplicationLocked(ActivityManagerService.java:4595)
	at com.android.server.am.ActivityManagerService.attachApplication(ActivityManagerService.java:4676)
	at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2404)
	at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2517)
	at android.os.Binder.execTransactInternal(Binder.java:1179)
	at android.os.Binder.execTransact(Binder.java:1143)
[-] XpeeN@sopuli.xyz 1 points 1 year ago
[-] Azzu@lemm.ee 1 points 1 year ago

While it's likely that sopuli changed something somewhere so that it fails, it's still a Firefox bug btw. There's just no reason it should crash.

[-] d4nm3d@demmy.co.uk 16 points 1 year ago

Would you mind explaining to me why i would want to do this? It's a genuine question.. i'm still learning Lemmy but do run my own instance just for my account.

[-] MedicareForSome@lemmy.ml 21 points 1 year ago

It makes it so that if you visit another instance using their URL, it will redirect you to your home version’s federated link.

E.g. if your home server is Lemmy.world, let’s say you find a link to Lemmy on another website but it’s a link to Lemmy.ml. If you click the link, you won’t be signed in.

So like:

https://lemmy.ml/c/memes would redirect to https://lemmy.world/c/memes@lemmy.ml

This way you can seamlessly use Lemmy.

Though I’m not familiar with this particular script. Scripts should be verified for security before installation.

[-] XpeeN@sopuli.xyz 5 points 1 year ago

Not only that, it transform posts link as well, which is awesome!

[-] d4nm3d@demmy.co.uk 1 points 1 year ago

That's great.. thank you... I've got it running but it's not recognising my home instance right now.

Is there a way to do it by manually? Like just change the url to match the instance that you want?

[-] _MoveSwiftly@lemmy.world 5 points 1 year ago

Hello there, and welcome to our community! I hope you like it in here.

Could you please include some body text as to why should people know this, and how would that help them? It’s our second rule. Thank you :)

[-] zorrothefox2001@lemmy.world 4 points 1 year ago

Is there any reason I should use ViolentMonkey vs TamperMonkey?

[-] itsnotlupus@lemmy.world 17 points 1 year ago

ViolentMonkey is open source, TamperMonkey is not.

You don't have to, but it'd be a lot cooler if you did.

[-] zorrothefox2001@lemmy.world 4 points 1 year ago

Lit, I'll check it out

[-] zorrothefox2001@lemmy.world 2 points 1 year ago

Yeah this is way better lol

[-] ggnoredo@lemm.ee 4 points 1 year ago

very nice ty

[-] ggnoredo@lemm.ee 2 points 1 year ago

is there any other script but for mastodon?

[-] SexualPolytope@lemmy.sdf.org 1 points 1 year ago

Nice. I was using another script, but this one seems so much better.

load more comments
view more: next ›
this post was submitted on 04 Jul 2023
191 points (98.0% liked)

You Should Know

33195 readers
50 users here now

YSK - for all the things that can make your life easier!

The rules for posting and commenting, besides the rules defined here for lemmy.world, are as follows:

Rules (interactive)


Rule 1- All posts must begin with YSK.

All posts must begin with YSK. If you're a Mastodon user, then include YSK after @youshouldknow. This is a community to share tips and tricks that will help you improve your life.



Rule 2- Your post body text must include the reason "Why" YSK:

**In your post's text body, you must include the reason "Why" YSK: It’s helpful for readability, and informs readers about the importance of the content. **



Rule 3- Do not seek mental, medical and professional help here.

Do not seek mental, medical and professional help here. Breaking this rule will not get you or your post removed, but it will put you at risk, and possibly in danger.



Rule 4- No self promotion or upvote-farming of any kind.

That's it.



Rule 5- No baiting or sealioning or promoting an agenda.

Posts and comments which, instead of being of an innocuous nature, are specifically intended (based on reports and in the opinion of our crack moderation team) to bait users into ideological wars on charged political topics will be removed and the authors warned - or banned - depending on severity.



Rule 6- Regarding non-YSK posts.

Provided it is about the community itself, you may post non-YSK posts using the [META] tag on your post title.



Rule 7- You can't harass or disturb other members.

If you harass or discriminate against any individual member, you will be removed.

If you are a member, sympathizer or a resemblant of a movement that is known to largely hate, mock, discriminate against, and/or want to take lives of a group of people and you were provably vocal about your hate, then you will be banned on sight.

For further explanation, clarification and feedback about this rule, you may follow this link.



Rule 8- All comments should try to stay relevant to their parent content.



Rule 9- Reposts from other platforms are not allowed.

Let everyone have their own content.



Rule 10- The majority of bots aren't allowed to participate here.

Unless included in our Whitelist for Bots, your bot will not be allowed to participate in this community. To have your bot whitelisted, please contact the moderators for a short review.



Partnered Communities:

You can view our partnered communities list by following this link. To partner with our community and be included, you are free to message the moderators or comment on a pinned post.

Community Moderation

For inquiry on becoming a moderator of this community, you may comment on the pinned post of the time, or simply shoot a message to the current moderators.

Credits

Our icon(masterpiece) was made by @clen15!

founded 1 year ago
MODERATORS