GameBanana CSS - Auto Sort By Rating (All Time)

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name          GameBanana CSS - Auto Sort By Rating (All Time)
// @namespace     http://userscripts.org/users/23652
// @description   Auto sorts CSS skins by rating if a sort method is not selected
// @include       http://css.gamebanana.com/*
// @include       https://css.gamebanana.com/*
// @copyright     JoeSimmons
// @version       1.0.0
// @license       GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @grant         GM_addStyle
// ==/UserScript==

+function () {
    'use strict';

    var links = document.querySelectorAll('a[href*="/skins/cats/"]'),
        rSkincat = /^https?:\/\/css\.gamebanana\.com\/skins\/cats\/\d+$/i,
        appendString = '?mid=SubmissionsList&vl[sort]=desc&vl[order]=rating&vl[filters][age]=all',
        link, i;

    // make sure the page is not in a frame
    if (window.frameElement || window !== window.top) { return; }

    if ( window.location.href.match(rSkincat) ) {
        window.location.href += appendString;
    } else {
        for (i = 0; link = links[i]; i += 1) {
            if ( link.href.match(rSkincat) ) {
                link.href += appendString;
            }
        }
    }
}();