sally_maria: Lego minifig monster pushing a trolley of books (Book Monster)
wrong but wromantic ([personal profile] sally_maria) wrote in [community profile] ao3some2015-12-30 10:42 pm

Removing collection from links

I have a minor problem with links on the archive, and I was wondering if anyone else felt the same way, and if they had come up with a solution. Being a ridiculously picky person, I don't like having a mixture of bookmarks, some to stories in collections, and others that aren't. So I always have to edit the URL to get the non-collection version of a link.

Does anyone know if there is a way to automate that, either something that defaults to taking you to the non-collection version or a button that removes the collection part of the link? I know it's a minor issue, and I can carry on the way I do at the moment, but if there is a solution, I'd be very grateful.
kate_nepveu: sleeping cat carved in brown wood (Default)

[personal profile] kate_nepveu 2015-12-31 03:48 am (UTC)(link)
There ought to be a way to use Javascript to create a bookmarklet to do it, but my coding is all cargo-cult, so my attempt once failed miserably. *tracks post*
rebecca2525: Abby Sciuto from NCIS with the word "geek" (Default)

[personal profile] rebecca2525 2015-12-31 10:12 am (UTC)(link)
It can be done with a bookmarklet. Make a new bookmark (to some random page if you can't create an empty one) and then change the location of that bookmark to this code:

javascript:url=window.location.href.replace(/collections\/.*?\//,'');window.location=url;


Now when your're on a work page, you can click that bookmark and it will reload the work without the collection part.

(Dreamwidth doesn't let me post a direct link to the bookmarklet, sorry. If you have a problem creating the bookmark, let me know.)
Edited 2015-12-31 10:16 (UTC)
kate_nepveu: sleeping cat carved in brown wood (Default)

[personal profile] kate_nepveu 2015-12-31 12:59 pm (UTC)(link)
You're amazing, thank you!
coprime: Marny bouncing (video games)

[personal profile] coprime 2015-12-31 03:38 pm (UTC)(link)
That is super useful, thank you!
alyndra: (Default)

[personal profile] alyndra 2019-06-28 10:39 pm (UTC)(link)
Omg I love you! I've manually deleted so many collection bits of urls, I'm so excited to find this!