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.
47 Comments - Last post 2 minutes ago by Chris76de
6 Comments - Last post 35 minutes ago by Masafor
76 Comments - Last post 2 hours ago by sensualshakti
34 Comments - Last post 2 hours ago by JMM72
4 Comments - Last post 2 hours ago by despiesi96
1,962 Comments - Last post 4 hours ago by MeguminShiro
15 Comments - Last post 5 hours ago by dingbat
463 Comments - Last post 49 seconds ago by Carenard
127 Comments - Last post 3 minutes ago by Tristanpew
28,515 Comments - Last post 4 minutes ago by faelynaris
64 Comments - Last post 5 minutes ago by PicoMan
19 Comments - Last post 8 minutes ago by lext
93 Comments - Last post 8 minutes ago by miIk
103 Comments - Last post 20 minutes ago by UltraMaster
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.