Topic: Is there any way to have the search automatically trimmed off of URLs?

Posted under General

So basically, I share a lot of art from e621. And because I don't really like sharing whatever it was I was searching at at the time, I trim off the search part of the URL. And it's, frankly, getting very annoying.

Honestly I don't understand the point of the feature. Yes, I get you can use it to navigate images one at a time, but I don't get why you'd want to do that.

Is there any way to have that excess URL automatically trimmed away? And ideally also remove the useless "search: none" bar left over (which seriously, why isn't that automatically a thing?)? It would bring my personal user experience with the site back to a much more enjoyable place.

I appreciate any responses! And sorry for the trouble. Hopefully there is some kind of feasible workaround.

bitWolfy

Former Staff

For the removing of the ?q=something line - I have that functionality in my userscript
If you prefer, I can make a separate userscript for you that does only that one thing. It's literally 1 line of code.

if(/^\/posts\/\d+$/.test(window.location.pathname)) window.history.replaceState(null, null, window.location.pathname);

The second part, about removing the "search: none" is a bit more involved, and I'll have to investigate it further.
But it too can be hidden away with a bit of javascript.

bitwolfy said:
For the removing of the ?q=something line - I have that functionality in my userscript
If you prefer, I can make a separate userscript for you that does only that one thing. It's literally 1 line of code.

if(/^\/posts\/\d+$/.test(window.location.pathname)) window.history.replaceState(null, null, window.location.pathname);

The second part, about removing the "search: none" is a bit more involved, and I'll have to investigate it further.
But it too can be hidden away with a bit of javascript.

I would really appreciate that! If you could make such a script, I would be very happy with that. Thank you so much!

The first thing is sufficient, it's my main annoyance. You don't need to bother with removing the search:none thing if it's any sort of a pain, I don't want to put more work on your plate unless it's not any trouble.

bitwolfy said:
The second part, about removing the "search: none" is a bit more involved, and I'll have to investigate it further.
But it too can be hidden away with a bit of javascript.

I've got a combo of userstyle and userscript for that one. The userstyle always hides .search-seq-nav, and also hides the #nav-links-top container until the userscript gets a crack at things. The userscript hides said container if there's no pool navigation element. I wouldn't be surprised if there can be other nav elements in that container, but it's not worried me.

bitWolfy

Former Staff

clawdragons said:
I would really appreciate that! If you could make such a script, I would be very happy with that. Thank you so much!

The first thing is sufficient, it's my main annoyance. You don't need to bother with removing the search:none thing if it's any sort of a pain, I don't want to put more work on your plate unless it's not any trouble.

Turned out to be easier than I thought. Implemented both requests.
The script is hosted here, or you can install it via a direct link. Tested with TamperMonkey.

Let me know if you run into any issues, or have any more requests.

Hey, great! It snips it right off.

That said, there's one problem. If I go to an image that's part of a pool, and there's search:none on the navbar, it won't just hide the search:none part but will also hide the pool navigation.

bitWolfy

Former Staff

clawdragons said:
Hey, great! It snips it right off.

That said, there's one problem. If I go to an image that's part of a pool, and there's search:none on the navbar, it won't just hide the search:none part but will also hide the pool navigation.

I did not consider that. My bad.
Updated version is available at the afformentioned page, or via a direct link.

  • 1