没事找脚本

支持随机查看脚本, 以及上一个和下一个脚本

安裝腳本?
作者推薦腳本

您可能也會喜歡 没事找用户

安裝腳本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         没事找脚本
// @namespace    http://tampermonkey.net/
// @version      0.5
// @description  支持随机查看脚本, 以及上一个和下一个脚本
// @author       mininb666
// @match        *://greasyfork.org/*/scripts/*
// @grant        GM_registerMenuCommand
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    GM_registerMenuCommand("上一个",()=>{
        location.href="https://greasyfork.org/scripts/"+(+location.href.substr(location.href.indexOf("scripts/")+8,(location.href.substr(location.href.indexOf("scripts/")+8)).indexOf("-"))-1)
    })
    GM_registerMenuCommand("下一个",()=>{
        location.href="https://greasyfork.org/scripts/"+(+location.href.substr(location.href.indexOf("scripts/")+8,(location.href.substr(location.href.indexOf("scripts/")+8)).indexOf("-"))+1)
    })
    GM_registerMenuCommand("试试手气",()=>{
        location.href="https://greasyfork.org/scripts/"+(Math.floor(Math.random()*444444));
    })
})();