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

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

// ==UserScript==
// @name         360Doc的登录弹窗、自动展开全文及去除浮动块
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  处理360Doc的登录弹窗、自动展开全文及去除浮动块
// @author       icescat
// @match        *://*.360doc.com/*
// @grant        none
// @license MIT
// ==/UserScript==
 
(function() {
    'use strict';
 
    const observer = new MutationObserver((mutations) => {
        mutations.forEach((mutation) => {
            if (mutation.addedNodes.length) {
                const loginPopup = document.getElementById('registerOrLoginLayer');
                loginPopup?.parentNode.removeChild(loginPopup);
 
                document.body.classList.remove('articleMaxH');
 
                const floatQRCode1 = document.getElementById('floatqrcode_1');
                floatQRCode1?.parentNode.removeChild(floatQRCode1);
 
                const floatQRCode2 = document.getElementById('floatqrcode_2');
                floatQRCode2?.parentNode.removeChild(floatQRCode2);
            }
        });
    });
 
    observer.observe(document.body, {
        childList: true,
        subtree: true
    });
})();