| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- /**
- * 动态加载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)
- })
|