雨课堂显示PPT-去掉"当前页面有动画"提示

自动移除"当前页面有动画,请听老师讲解"的遮罩(在雨课堂上课界面右上角也添加了按钮,也可手动点击)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
// ==UserScript==
// @name         雨课堂显示PPT-去掉"当前页面有动画"提示
// @namespace    https://github.com/hui-shao
// @homepage     https://greasyfork.org/zh-CN/scripts/447478
// @homepageURL  https://greasyfork.org/zh-CN/scripts/447478
// @license      GPLv3
// @version      0.3
// @description  自动移除"当前页面有动画,请听老师讲解"的遮罩(在雨课堂上课界面右上角也添加了按钮,也可手动点击)
// @author       hui-shao
// @match        https://*.yuketang.cn/lesson/fullscreen/v*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=yuketang.cn
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    function createButton() {
        //alert("btn");
        var button = document.createElement("button");
        button.id = "btn001";
        button.textContent = "移除";
        button.style.color = "black";
        button.style.width = "100px";
        button.style.height = "80%";
        button.style.align = "center";
        button.style.marginTop = "0.2%";
        button.style.marginRight = "1.5%";
        document.querySelector(".lesson__header").appendChild(button);
        button.onclick = function () {
            console.log("[Script] Pressed the button.");
            myRemove();
        };
    }

    function myRemove() {
        console.log("[Script] Tried to remove.");
        document.querySelector(".slide__cmp").style.display="";
        document.querySelector(".ppt__modal.box-center").style.display="none";
    }

    document.onreadystatechange = ()=>{
        if(document.readyState == "complete") {
            console.log("[Script] Tried to Create Btn");
            createButton();

            const targetNode = document.querySelector(".slide__wrap.box-center");
            const config = { attributes: true, childList: true, subtree: true };
            const callback = function(mutationsList, observer) {
                // Use traditional 'for loops' for IE 11
                for(let mutation of mutationsList) {
                    if (mutation.type === 'childList') {
                        console.log('[Script] A child node has been added or removed.');
                    }
                    else if (mutation.type === 'attributes') {
                        console.log('[Script] The ' + mutation.attributeName + ' attribute was modified.');
                    }
                }
                myRemove(); // Auto Remove when DOM changes
            };

            const observer = new MutationObserver(callback);
            observer.observe(targetNode, config);
        }
    };

})();