360Doc的登录弹窗、自动展开全文及去除浮动块

处理360Doc的登录弹窗、自动展开全文及去除浮动块

  1. // ==UserScript==
  2. // @name 360Doc的登录弹窗、自动展开全文及去除浮动块
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description 处理360Doc的登录弹窗、自动展开全文及去除浮动块
  6. // @author icescat
  7. // @match *://*.360doc.com/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11. (function() {
  12. 'use strict';
  13. const observer = new MutationObserver((mutations) => {
  14. mutations.forEach((mutation) => {
  15. if (mutation.addedNodes.length) {
  16. const loginPopup = document.getElementById('registerOrLoginLayer');
  17. loginPopup?.parentNode.removeChild(loginPopup);
  18. document.body.classList.remove('articleMaxH');
  19. const floatQRCode1 = document.getElementById('floatqrcode_1');
  20. floatQRCode1?.parentNode.removeChild(floatQRCode1);
  21. const floatQRCode2 = document.getElementById('floatqrcode_2');
  22. floatQRCode2?.parentNode.removeChild(floatQRCode2);
  23. }
  24. });
  25. });
  26. observer.observe(document.body, {
  27. childList: true,
  28. subtree: true
  29. });
  30. })();