Greasy Fork

Greasy Fork is available in English.

隐藏键盘

闯关时隐藏下面的键盘(原vip功能)

当前为 2024-10-18 提交的版本,查看 最新版本

// ==UserScript==
// @name        隐藏键盘
// @namespace   https://github.com/nelvko/script/blob/master/youhou/hidden-keyboard.js
// @match        *://www.edclub.com/sportal/*
// @match        *://www.typingclub.com/sportal/*
// @grant       none
// @version     1.0
// @author      nelvko
// @license MIT
// @description 闯关时隐藏下面的键盘(原vip功能)
// ==/UserScript==
(function () {
    'use strict';
    // 创建一个 MutationObserver 来监听元素的加载
    const observer = new MutationObserver(() => {
        const keyboard = document.getElementsByClassName("keyboard-plugin");
        const ad = document.getElementById("adslot_video")
        // console.log("keyboard", keyboard);
        // console.log("ad", ad);

        if (keyboard && keyboard[0]) {
            keyboard[0].style.setProperty('visibility', 'hidden', 'important');
        }
        if (ad) {
            ad.style.setProperty('visibility', 'hidden', 'important');
            // observer.disconnect();
        }
    });

    observer.observe(document.body, { childList: true, subtree: true });
})();