i find it annoying to have to manually change urls to subscribe to a community outside lemmy.world, so i wrote a bookmarklet to quickly switch to the lemmy.world instance

to use, just drag the following code to your bookmarks bar (name it whatever you like), then click it when you want to use it

javascript:(function() {const myInst="lemmy.world";let currUrl=window.location.toString().split("/");let currInst=currUrl[2];currUrl[2]=myInst;let newUrl=currUrl.join("/")+"@"+currInst;window.location=newUrl;})();

readable version:

javascript:(
	function() {
		// make sure to change this if using on a different instance
		const myInst="lemmy.world";
		let currUrl=window.location.toString().split("/");
		let currInst=currUrl[2];
		currUrl[2]=myInst;
		let newUrl=currUrl.join("/")+"@"+currInst;
		window.location=newUrl;
	})
()
  • Ɀeus@lemmy.worldOP
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    1 year ago

    i’ll be honest, i’m not sure what that’s for? is it moving to another account if you want to change your home instance? if so, that’s a good idea, i could add it to the post if you want in case this comment gets buried

    spoiler

    although i’m not entirely certain using https://github.com/Rob--W/cors-anywhere/issues/301 is a great idea…

    • Yoru@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      I didn’t want to use it but I didn’t see any other way to tackle the cors issue