I just noticed I forgot to finish reading your comment because I was so focused on getting rid of the German link. It's not my first script but the first one I published. My first one was the previous take on this problem with which I added a button to the Store that leads to the cleaned URL. I wanted to make it work automatically but didn't know how back then.
Comment has been collapsed.
I improved your script a bit:
// ==UserScript==
// @name Steam Store - URL Cleaner
// @namespace Steam Store - URL Cleaner
// @description Cleans the URL for Steam Store pages
// @version 1.0
// @grant none
// @run-at document-start
// @include /^https?:\/\/store\.steampowered\.com.*$/
// ==/UserScript==
if (window.location.search.length > 0) window.location.href = window.location.href.replace(window.location.search, "");
Comment has been collapsed.
It took me some time to understand your changes but yeah, your solution is a lot cleaner (no pun intended). I found it hard to write the script because I wasn't even sure what I had to look for. You never stop learning, thanks. :) It's not my work so I won't change my script but of course you are free to publish it on your own.
Comment has been collapsed.
Mature userscripts? Oh my I wonder what those are -- dat sexy code. xD
Comment has been collapsed.
I'm not even sure how he did it, because the only options I get to create a script are public, unlisted or library. No private.
Comment has been collapsed.
I think I found the issue: When I published the script I saw a section about "mature content" and skipped it because usually it's opt-in but it's opt-out on Greasyfork. I have changed it now but it seems like a moderator needs to validate it first. Well, now I know better for the next time.
Comment has been collapsed.
Isn't it easier to include http://store.steampowered.com/*
? I don't think the store is offered on HTTPS, at least not for me.
Comment has been collapsed.
You can also replace the URL without reloading the page at all:
if (window.location.search.length > 0) {
window.history.pushState(null, null, window.location.href.replace(window.location.search, ""));
}
Thanks Royal for making me aware of window.location.search. I didn't know about it, could come very in handy. :)
Comment has been collapsed.
taking a mix of all of the above for my use.. so many suggestions ^^
in case anyone wants the mix i'm using. (credit goes to all the other people here other then me, mostly ofc vonRaven)
// ==UserScript==
// @name Steam Store - URL Cleaner
// @namespace Steam Store - URL Cleaner
// @description Cleans the URL for Steam Store pages
// @version 1.0
// @grant none
// @run-at document-start
// @match *://store.steampowered.com/*
// ==/UserScript==
if (window.location.search.length > 0) {
window.history.pushState(null, null, window.location.href.replace(window.location.search, ""));
}
Comment has been collapsed.
540 Comments - Last post 8 minutes ago by Ledyba
15 Comments - Last post 13 minutes ago by SecOps
5 Comments - Last post 39 minutes ago by Sh4dowKill
1,763 Comments - Last post 43 minutes ago by MeguminShiro
47,106 Comments - Last post 1 hour ago by kbronct
49 Comments - Last post 1 hour ago by blueflame32
4 Comments - Last post 1 hour ago by ZPE
160 Comments - Last post 8 minutes ago by antidaz
790 Comments - Last post 37 minutes ago by MayoSlice
70 Comments - Last post 45 minutes ago by cg
21 Comments - Last post 59 minutes ago by Kyog
9 Comments - Last post 1 hour ago by reallurker
175 Comments - Last post 1 hour ago by samwise84
10 Comments - Last post 1 hour ago by Fluffster
This is not a Userscript for SG but for the Steam store. I thought I would share it nonetheless since it's something that has bugged me for a long time.
When browsing the Steam store the URL often contains additions at the end like "?snr=1_4_4__100" to track where you clicked on the link. This is helpful for Valve to see what areas of the Steam store are used the most. For me it became annoying because I bookmark interesting games and ended up with lots of duplicates because of the different URL endings.
This script will automatically replace the URL with a cleaned one without reloading the page. So "http://store.steampowered.com/app/440/?snr=1_4_4__100" for example would become "http://store.steampowered.com/app/440/".
Download
Comment has been collapsed.