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.
194 Comments - Last post 1 minute ago by Acojonancio
17 Comments - Last post 4 minutes ago by DrT3RR0R
23 Comments - Last post 28 minutes ago by Seibitsu
64 Comments - Last post 52 minutes ago by Bloodfall
16,526 Comments - Last post 1 hour ago by rayyyy91
56 Comments - Last post 2 hours ago by FranckCastle
13 Comments - Last post 3 hours ago by SolvedPack
8,371 Comments - Last post 3 minutes ago by ExcelElmira
3,597 Comments - Last post 53 minutes ago by masterbubu87
7 Comments - Last post 1 hour ago by Lugum
13 Comments - Last post 1 hour ago by xarabas
954 Comments - Last post 1 hour ago by Codric
29,149 Comments - Last post 1 hour ago by MrSick
1 Comments - Last post 1 hour ago by GeoSol
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.