Last active
December 2, 2022 07:06
-
-
Save Luckz/31480559190ce77bdfd249f4ae429219 to your computer and use it in GitHub Desktop.
SteamSearchSearchparamSanitizer.user.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Steam Search SearchParam Sanitizer | |
// @namespace luckz | |
// @author luckz | |
// @version 0.3 | |
// @description fix "titles have been excluded based on your preferences" from language filtering | |
// @match https://store.steampowered.com/search/* | |
// @grant none | |
// @downloadURL https://gist.github.com/Luckz/31480559190ce77bdfd249f4ae429219/raw/SteamSearchSearchparamSanitizer.user.js | |
// @updateURL https://gist.github.com/Luckz/31480559190ce77bdfd249f4ae429219/raw/SteamSearchSearchparamSanitizer.user.js | |
// ==/UserScript== | |
// aggressive mode forces always refreshing, not only when needed, which results in nicer-looking URLs to paste elsewhere. | |
const AGGRESSIVE = false; | |
const url = new URL(location); | |
const wp = document.getElementById('search_results_filtered_warning_persistent'); | |
const warning = !wp?.hasClassName('collapsed') && wp?.hasChildNodes(); | |
if (warning || AGGRESSIVE && (!(url.searchParams.get('ndl') === '1') || url.searchParams.has('supportedlang'))) { | |
console.log(`Steam Search SearchParam Sanitizer: ${warning}, ${!(url.searchParams.get('ndl') === '1')}, ${url.searchParams.has('supportedlang')}`); | |
url.searchParams.set('ndl', 1); | |
url.searchParams.delete('supportedlang'); | |
location = url; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment