ctr1@fl0w.cctoLemmy@lemmy.ml•Shortcut to go to `YOUR instance` from `ANY Sublemmy`English
3·
1 year agoThanks! This works pretty well for now, until a more integrated solution comes along. I made a slight modification, since the original script only works when you’re at the community level. This version redirects community URLs as before, but also redirects any non-matching URLs to the search form of your home instance. It seems to work pretty well for posts. Comments and user profiles have some issues- searching comments works as long as the user is commenting on their own instance, and searching profiles works as long as the user is registered with that instance.
javascript:(() => { const inst = "lemmy.world"; const m = location.href.match(/(?:.*)\/c\/(.*(?=\/)|.*$)/i); if (m) { location.href = `https://${inst}/c/` + m[1] + "@" + location.host.toString(); } else if (location.host !== inst) { const q = new URLSearchParams(); q.append('q', location.href); location.href = `https://${inst}/search?${q.toString()}`; }})()
An extension would be cool! I’m currently trying to do something similar, in some sense; I’ve patched my instance to filter out DB results from public queries so that only my posts and comments are visible (unless I am logged in).
I believe it might be possible, but I’m not sure. It seems that the protocol itself is mostly geared for synchronizing data and distributing updates. From my limited understanding, servers follow users or communities on other servers, which inform those servers that updates should be sent to the requesting inbox. These updates are then used to build up a local copy of the remote page. In the case of a remote community, users interact with their local copy and notify the remote community of those changes.
For example, I am viewing a local copy of this post that I received from lemmy.ml, and my reply to your comment will be stored locally. My server will notify lemmy.ml of this comment (including its contents), and lemmy.ml will notify my inbox if anyone interacts with it (because I am a follower).
It seems that at least some of this syncing might not be necessary… a lightweight frontend could rely on the API of each site it connects with to build up the activities it sends. However, this would probably cause some unnecessary traffic, as such a follower would both receive updates and query the API. Also it would probably break some things, such as
ap_id
(see the multicolored fedilink icon, which points the original copy of the content on my instance).