/** * 动态加载JavaScript文件 * @param {string} url - JS文件的URL * @param {Function} callback - 加载成功后的回调函数 * @param {Function} errorCallback - 加载失败后的回调函数 */ function loadJS(url, callback, errorCallback) { // 创建script标签 const script = document.createElement('script'); script.type = 'text/javascript'; script.src = url; // 设置加载成功回调 script.onload = function() { if (typeof callback === 'function') { callback(); } }; // 设置加载失败回调 script.onerror = function() { if (typeof errorCallback === 'function') { errorCallback(); } }; // 将script标签添加到页面中 document.head.appendChild(script); } window.statusInfo = "空闲中" window.darw = {} if (location.href.startsWith('https://www.douyin.com/user/')) { if (localStorage.getItem('dqrw')) { window.statusInfo = "运行中" window.darw = JSON.parse(localStorage.getItem('dqrw')) } } // 获取tooltip元素 const tooltip = document.getElementById('tooltip'); // 同时触发pointerenter和mouseenter事件 function triggerHoverEvents() { // 1. 触发pointerenter事件 const pointerEnterEvent = new PointerEvent('pointerenter', { bubbles: true, cancelable: true, view: window, pointerId: 1, pointerType: 'mouse', isPrimary: true }); // 2. 触发mouseenter事件 const mouseEnterEvent = new MouseEvent('mouseenter', { bubbles: true, cancelable: true, view: window, clientX: 100, clientY: 100 }); // 3. 触发pointerover(如果需要) const pointerOverEvent = new PointerEvent('pointerover', { bubbles: true, cancelable: true, view: window, pointerId: 1, pointerType: 'mouse' }); // 4. 触发mouseover(如果需要) const mouseOverEvent = new MouseEvent('mouseover', { bubbles: true, cancelable: true, view: window, clientX: 100, clientY: 100 }); // 按顺序同时触发所有事件 // document.querySelectorAll('.semi-dropdown-item')[8].click() // tooltip.dispatchEvent(pointerOverEvent); window.checkClock1 = setInterval(() => { tooltip.dispatchEvent(mouseOverEvent); }, 100); window.checkClock2 = setInterval(() => { try { document.querySelectorAll('.semi-dropdown-item')[8].click() clearInterval(window.checkClock1) clearInterval(window.checkClock2) } catch (error) { console.log(error) } }, 500); console.log('Pointer和Mouse进入事件已同时触发'); } // setTimeout(() => { // if (location.href.startsWith('https://www.douyin.com/user/')) { // // 执行触发 // triggerHoverEvents(); // setTimeout(() => { // document.querySelectorAll('.ug0uBNhF div').forEach(element => { // if (element.querySelector('span')) { // const typeText = element.querySelector('span').innerText // console.log(typeText) // if (typeText == window.darw.jbxx.split('-')[0]) { // element.querySelector('.A9Seu0Hm').click() // } // } // }); // // 二级举报 // setTimeout(() => { // document.querySelectorAll('.ug0uBNhF div').forEach(element => { // if (element.querySelector('span')) { // const typeText = element.querySelector('span').innerText // console.log(typeText) // if (typeText == window.darw.jbxx.split('-')[1]) { // element.querySelector('.A9Seu0Hm').click() // } // } // }); // }, 3000); // document.querySelector('.mlG4sNlr textarea').value = window.darw.jbly // setTimeout(() => { // // document.querySelector('button.GPAlcn2R').click() // }, 5000); // }, 5000); // } // }, 5000); loadJS('https://html2canvas.hertzen.com/dist/html2canvas.min.js') function captureAndDownload(element) { html2canvas(element, { scale: 2, // 提高截图质量 useCORS: true, // 允许跨域图片 backgroundColor: null // 透明背景 }).then(canvas => { // 创建下载链接 const link = document.createElement('a'); link.download = '截图.png'; link.href = canvas.toDataURL('image/png'); link.click(); }); } loadJS('https://cunchu.site/puge/ws.js', () => { let wsOptions = { isAdmin: false, onReady: () => { console.log('ws连接成功'); } } wsOptions.messageCallBack = (meg) => { switch (meg.type) { case "getInfo": { owoSocket.send("getInfo", { url: location.href, status: window.statusInfo }, meg.userID) break } case "ksjb": { if (window.statusInfo == "空闲中") { console.log(meg.value); window.dqrw = meg.value window.statusInfo = "运行中" localStorage.setItem("dqrw", JSON.stringify(meg.value)) location.href = meg.value.url } break } } } window.owoSocket = new owoSocket('抖音举报', wsOptions) })