Steam search filter for Linux

Always filter for linux

目前为 2015-10-31 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Steam search filter for Linux
  3. // @namespace jones.herbert@gmail.com
  4. // @description Always filter for linux
  5. // @include http://store.steampowered.com/search/*
  6. // @include https://store.steampowered.com/search/*
  7. // @version 1
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. function LocationSearchPairs()
  12. {
  13. if (location.search.length == 0)
  14. {
  15. return [];
  16. }
  17. else
  18. {
  19. var keyAndValue = location.search.substr(1).split('&');
  20. return keyAndValue.map(function (item)
  21. {
  22. var splitResult = item.split('=', 2);
  23. if (splitResult.length == 2)
  24. return splitResult;
  25. return [item,''];
  26. });
  27. }
  28. }
  29.  
  30. var searchMap = new Map(LocationSearchPairs());
  31. if (!searchMap.has('os') || searchMap.get('os') != "linux")
  32. {
  33. searchMap.set('os', 'linux');
  34.  
  35. var pairs = [];
  36. searchMap.forEach(function(value, key) {
  37. pairs.push(key + '=' + value);
  38. });
  39. location.search = '?' + pairs.join('&');
  40. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址