Florr IO 手动切换服务器

不用再打开开发者工具了

// ==UserScript==
// @name            Florr IO 手动切换服务器
// @name:zh         Florr IO 手动切换服务器
// @name:en         Florr IO Manual server switch
// @namespace       A florr.io userjs by Tinhone
// @description     不用再打开开发者工具了
// @description:zh  不用再打开开发者工具了
// @description:en  No need to open the dev tool again
// @version         0.2.1
// @author          Tinhone
// @license         GPL-3.0
// @match           *://*.florr.io/*
// @grant           unsafeWindow
// @grant           GM_addStyle
// @compatible      firefox V50+
// @compatible      edge V50+
// @compatible      chrome V50+
// @icon            data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAB2lBMVEUAAADTvUbTvUbTvUbTvUbTvUbTvUbTvUbTvUbTvUbTvUbTvUbTvUbTvUbSvEbTvUbSvUbTvUbSvEbTvUbTvUbTvUbTvUbTvUbTvUbTvUbTvUbTvUbSvEbTvUbSvEbUvkfWwEjYwUnVv0fex03p0lXy21r331754V/y2lrp0lTdx03UvkbgyU/y21v95WL/6GP/52P95WHgyU7XwUns1Vfs1VbXwUjZwkrYwkn03mLm0mH85WLm0mL03mHfyU7742HYzZHU0cLhz2z/6GLj0m7W08TUyY3742DVvkfp1WHe28r8/f/Yz5f85GD85F/Rx4/8/P/j4NDu2WX85WHTvUb/6mTNu1erqqX7/P7c1rT332D13l6Ykm/n6Oru7ejl02/o0lTSvEbAr1A0MzBoaGp+eFvz3F/03WBUTzJPT1FvbmvHtlfx2lrOu1UsKyQaGx1eWDL54mFgWTQbHB4qKCLNu1T2313q1V1GQy0bHCCMgUH/6WSjlUhcVjPbx1j75WL03mDo0VT+6WT65GL+5mPdxk21pEaqmkL03V/75GLCsEuQgjj34GDjzliEeDNuYyuGeTSLfjZ2ay5zaC3Pu1D/6GT85mPgy1fDsUy+rErSvlL34WDr1Fb////IkFdGAAAAH3RSTlMAAA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ownFunction=window.onkeydown?window.onkeydown:function(e){}
    function customServer(){
        let name=prompt("请输入需要切换的服务器名称 Please enter the server name to switch")
        if(name){cp6.forceServerID(name)}
    }
    window.onkeydown=(e)=>{
        onkeydownFunction(e) //当 window.onkeydown 已有其他代码需要执行时,先让其他代码执行
        switch(e.key){
            case "?": //ctrl+shift+/
                if(e.ctrlKey){customServer()}
                return
            default:
                return
        }
        e.preventDefault()
    }
})()