Greasy Fork 还支持 简体中文。

GameBanana CSS - Auto Sort By Rating (All Time)

Auto sorts CSS skins by rating if a sort method is not selected

  1. // ==UserScript==
  2. // @name GameBanana CSS - Auto Sort By Rating (All Time)
  3. // @namespace http://userscripts.org/users/23652
  4. // @description Auto sorts CSS skins by rating if a sort method is not selected
  5. // @include http://css.gamebanana.com/*
  6. // @include https://css.gamebanana.com/*
  7. // @copyright JoeSimmons
  8. // @version 1.0.0
  9. // @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
  10. // @grant GM_addStyle
  11. // ==/UserScript==
  12.  
  13. +function () {
  14. 'use strict';
  15.  
  16. var links = document.querySelectorAll('a[href*="/skins/cats/"]'),
  17. rSkincat = /^https?:\/\/css\.gamebanana\.com\/skins\/cats\/\d+$/i,
  18. appendString = '?mid=SubmissionsList&vl[sort]=desc&vl[order]=rating&vl[filters][age]=all',
  19. link, i;
  20.  
  21. // make sure the page is not in a frame
  22. if (window.frameElement || window !== window.top) { return; }
  23.  
  24. if ( window.location.href.match(rSkincat) ) {
  25. window.location.href += appendString;
  26. } else {
  27. for (i = 0; link = links[i]; i += 1) {
  28. if ( link.href.match(rSkincat) ) {
  29. link.href += appendString;
  30. }
  31. }
  32. }
  33. }();