🏠 Home 

彩云小译 - 关闭字数限制弹窗

关闭彩云小译达到 5000 词的弹窗


Install this script?
  1. // ==UserScript==
  2. // @name 彩云小译 - 关闭字数限制弹窗
  3. // @description 关闭彩云小译达到 5000 词的弹窗
  4. // @author Bush2021
  5. // @match https://fanyi.caiyunapp.com/*
  6. // @icon https://caiyunapp.com/favicon.ico
  7. // @version 0.1
  8. // @license MIT
  9. // @namespace https://greasyfork.org/users/737511
  10. // ==/UserScript==
  11. (function() {
  12. 'use strict';
  13. // 监听 DOM 变化
  14. const observer = new MutationObserver((mutationsList) => {
  15. for(let mutation of mutationsList) {
  16. const elMessageBoxHeaderBtn = document.querySelector(".el-message-box__headerbtn");
  17. if (mutation.type === 'childList' && mutation.addedNodes.length > 0 && elMessageBoxHeaderBtn) {
  18. elMessageBoxHeaderBtn.click();
  19. }
  20. }
  21. });
  22. // 配置观察选项
  23. const config = { attributes: true, childList: true, subtree: true };
  24. // 开始观察目标节点
  25. observer.observe(document.body, config);
  26. })();