您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
每秒检查是否开启了剧场模式,开启则隐藏窗口内其他元素。
当前为
// ==UserScript== // @name 战旗剧场模式窗口全屏 // @namespace com.van.zq // @version 2.5 // @description 每秒检查是否开启了剧场模式,开启则隐藏窗口内其他元素。 // @author van // @match *://www.zhanqi.tv/* // @grant none // ==/UserScript== (function() { //判断是否是直播页面 if(document.getElementById("js-room-super-panel")) { window.isTheater = false; window.getZIndex = function (e) { var z = window.document.defaultView.getComputedStyle(e).getPropertyValue('z-index'); if (isNaN(z)) return window.getZIndex(e.parentNode); return z; }; window.getStyle = function(className, name) { var element = document.getElementsByClassName(className)[0]; return element.currentStyle ? element.currentStyle[name] : window.getComputedStyle ? window.getComputedStyle(element, null).getPropertyValue(name) : null; }; window.checkMode = function() { if(document.getElementsByClassName("topBar-bg").length > 0) { //横版菜单 return 1; } else { //竖版菜单 return 0; } }; //check if we are using threater mode window.isTheaterMode = function() { if(mode == 1 && getStyle("topBar-bg","display") == "none") { return true; } else if (mode == 0 && getZIndex(starLeftPanel) == 0) { return true; } else { return false; } }; window.check = function() { //判断是否剧场模式,是否需要隐藏窗口 if(isTheaterMode() && !isTheater) { isTheater = true; chatpanel.style.width = "0px"; flashpanel.style.width = "100%"; giftpanel.style.zIndex = 0; giftpanel.style.display = "none"; //竖版隐藏面板 if(mode == 0) { starLoginPanel.style.display = "none"; if(starTopPanel){ starTopPanel.style.display = "none"; } if(starButtomPanel) { starButtomPanel.style.display = "none"; } } //分享主播窗口 if(sharepanel){ sharepanel.style.display = "none"; } } else if(!isTheaterMode() && isTheater) { isTheater = false; chatpanel.style.width = "340px"; giftpanel.style.zIndex = 13; giftpanel.style.display = "block"; if(mode == 0) { starLoginPanel.style.display = "block"; if(starTopPanel){ starTopPanel.style.display = "block"; } if(starButtomPanel){ starButtomPanel.style.display = "block"; } } } }; //竖版登录面板 var starLoginPanel = document.getElementsByClassName("live-room-side")[0]; //竖版页首面板 var starTopPanel = document.getElementsByClassName("live-stars-top")[0]; //竖版底部面板 var starButtomPanel = document.getElementsByClassName("live-stars-bottom")[0]; //竖版左面板,用于判断是否剧场模式 var starLeftPanel = document.getElementsByClassName("live-side-content")[0]; //礼物面板 var giftpanel = document.getElementsByClassName("js-room-fun-area")[0]; //分享面板 var sharepanel = document.getElementById("js-share-guide-panel"); //聊天窗口 var chatpanel = document.getElementById("js-right-chat-panel"); //主播放窗口 var flashpanel = document.getElementById("js-flash-panel"); var mode = checkMode(); //每隔1秒检查一次是否剧场模式 window.setInterval(check,1000); } })();