会议自动登录(不可用)

会议自动登录(不可用),退出脚本1

目前為 2024-12-12 提交的版本,檢視 最新版本

// ==UserScript==
// @name         会议自动登录(不可用)
// @namespace    http://tampermonkey.net/
// @version      1.0.1
// @description  会议自动登录(不可用),退出脚本1
// @author       lhq
// @match        https://voovmeeting.com/r*
// @grant        GM_xmlhttpRequest
// @connect      159.75.172.230
// @license      MIT
// ==/UserScript==

let timer = null;

const simulateInputEvent = (inputElement) => {
  const inputEvent = new Event("input", {
    bubbles: true,
    cancelable: true,
  });
  const changeEvent = new Event("change", {
    bubbles: true,
    cancelable: true,
  });
  // 派发input事件
  inputElement.dispatchEvent(inputEvent);
  // 派发change事件
  inputElement.dispatchEvent(changeEvent);
};

const simulateKeyboardInput = (inputElement, value) => {
  inputElement.value = "";
  simulateInputEvent(inputElement);
  const chars = value.split("");
  chars.forEach((char) => {
    const event = new KeyboardEvent("keypress", {
      bubbles: true,
      cancelable: true,
      charCode: char.charCodeAt(0),
    });
    // 模拟输入字符
    inputElement.value += char;
  });
  simulateInputEvent(inputElement);
};

const getValueByCookie = (name) => {
  var cookieArray = document.cookie.split(";");
  var cookieMap = cookieArray.map(function (cookie) {
    var parts = cookie.split("=");
    return {
      key: parts[0].trim(),
      value: parts[1] ? parts[1].trim() : "",
    };
  });
  for (var i = 0; i < cookieMap.length; i++) {
    if (cookieMap[i].key === name) {
      return cookieMap[i].value;
    }
  }
  return null;
};

const btnClick = () => {
  const button = document.querySelector(".join-form__button");
  if (button) {
    button.click();
  }
  console.log("button");
};

const setValue = (val1, val2) => {
  const codeInput = document.querySelector(".join-form__code-item > input");
  if (codeInput) {
    simulateKeyboardInput(codeInput, val1);
  }
  const nicknameInput = document.querySelector(
    ".join-form__nickname-item > input"
  );
  if (nicknameInput) {
    simulateKeyboardInput(nicknameInput, val2);
  }
};

const requestApi = (userId) => {
  GM_xmlhttpRequest({
    method: "GET",
    url: "http://159.75.172.230:8080/getJoinTask?userCode=" + userId,
    onload: function (response) {
      const res = JSON.parse(response.responseText);
      console.log(res?.meetingCode);
      if (res?.meetingCode) {
        clearInterval(timer);
        setValue(res.meetingCode, res.personName);
        btnClick();
        console.log("请求成功清除定时器");
      }
    },
    onerror: function (response) {
      console.log("请求失败");
    },
  });
};

(function () {
  "use strict";
  const userId = getValueByCookie("app_uid");
  console.log("initinit", userId);
  if (userId && window.location.href === "https://voovmeeting.com/r") {
    timer = setInterval(() => {
      requestApi(userId);
    }, 5000);
  }
  setInterval(() => {
    const endDialog = document.querySelector("#tea-overlay-root button");
    console.log(endDialog, "endDialog");
    if (endDialog) endDialog.click();
  }, 5000);
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址