Skip to content

Instantly share code, notes, and snippets.

@Luckz
Last active December 2, 2022 07:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Luckz/31480559190ce77bdfd249f4ae429219 to your computer and use it in GitHub Desktop.
Save Luckz/31480559190ce77bdfd249f4ae429219 to your computer and use it in GitHub Desktop.
SteamSearchSearchparamSanitizer.user.js
// ==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