Scripts目录不再必要存在,并移除 livePage.js; 调整项目结构

This commit is contained in:
梅浩东
2025-04-14 16:18:49 +08:00
parent 15bbe3bead
commit 1b747146f9
15 changed files with 80 additions and 106 deletions
-26
View File
@@ -6,35 +6,9 @@
* 正则: @".*:\/\/live.douyin\.com\/\d+"
**/
/*注入脚本 定时触发全局keydown,避免直播流被无操作阻断*/
// 创建一个虚拟的按键事件
const simulatedEvent = new KeyboardEvent('keydown', {
key: 'Virtual_Alt',
keyCode: 18, //alt
bubbles: true,
cancelable: true
});
// 获取要分派事件的目标元素,例如文档的根元素
const targetElement = document.documentElement;
// 设置定时器,每隔60秒模拟一次按键事件
setInterval(() => {
targetElement.dispatchEvent(simulatedEvent);
}, 1000 * 60);
// 订阅 keydown 事件 (Debug)
targetElement.addEventListener('keydown', event => {
if (event.key == "Virtual_Alt") {
console.log('[防挂机处理] 按下了', event.key);
}
});
/*禁止关闭 Websocket*/
WebSocket.prototype.close = function () { return; }
/*判断是否自动关闭 */
//获取路由参数
function getQueryString(name) {