visibilitychange

let hidden,visibilitychange;
        if(typeof document.hidden !== "undefined"){
            hidden = "hidden";
            visibilitychange = "visibilitychange"
        }else if(typeof document.webkitHidden !== "undefined"){
            hidden = "webkitHidden";
            visibilitychange = "webkitvisibilitychange"
        }else if(typeof document.msHidden !== "undefined"){
            hidden = "msHidden";
            visibilitychange = "msvisiblitychange"
        }
        document.addEventListener(visibilitychange, ()=> {
            if(document['hidden']){
                game.stop()
            }
        })
        const originalData = [...answerData]
        originalData.forEach((item)=>{
            if(item.type === 'markdown'){
                item.content = item.content[0]
            }
        })

 

posted @ 2024-11-27 11:03  国服第一李师师  阅读(2)  评论(0编辑  收藏  举报