Florr IO 自动启用调试信息

通过模拟按下分号键以自动启用调试信息

// ==UserScript==
// @name            Florr IO 自动启用调试信息
// @name:zh         Florr IO 自动启用调试信息
// @name:en         Florr IO Auto Enable Debug Information
// @namespace       A florr.io userjs by Tinhone
// @description     通过模拟按下分号键以自动启用调试信息
// @description:zh  通过模拟按下分号键以自动启用调试信息
// @description:en  Enable debug information automatically by simulating click the semicolon key
// @version         0.2.1
// @author          Tinhone
// @license         GPL-3.0
// @run-at          document-start
// @match           *://*.florr.io/*
// @grant           none
// @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+r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{
    'use strict'
    let fakePressCount=0
    let fakePressLoop=setInterval(()=>{
        const fakeSemicolon=new KeyboardEvent('keydown',{
            bubbles: true,
            cancelable: true,
            keyCode: 186,
            shiftKey: false,
            ctrlKey: false,
            altKey: false,
            meta: false,
            key: ';'
        })
        document.dispatchEvent(fakeSemicolon)
        if (document.querySelector("html body canvas#canvas")!=null && document.querySelector("html body canvas#canvas").attributes.style.textContent=="display: block; cursor: default;"){fakePressCount++}
        if (fakePressCount==2){clearInterval(fakePressLoop)}
    },500)
})()