Greasy Fork

Greasy Fork is available in English.

优化启航教育的浏览体验

去掉延迟加载的没卵用的聊天框和广告

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         优化启航教育的浏览体验
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  去掉延迟加载的没卵用的聊天框和广告
// @author       HqLin
// @match        *://www.iqihang.com/*
// @icon         https://www.google.com/s2/favicons?domain=iqihang.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    // 按照规范,第一个参数是变化列表,第二个是监听器本身
    new MutationObserver((changeList, ob) => {
        const chat = document.querySelector("#MANTIS-CHAT-DIV");
        if (chat !== null){
            chat.remove();
            // 完成任务之后就不用再监听了。
            ob.disconnect();
            // 管他加载出来没呢,有就干掉。
            let ad = document.querySelector("section .courseActive");
            ad && ad.remove();
        }
        // 只用监听子元素,不用监听属性之类的。
    }).observe(document.body, {childList: true});
    // 连带侧边栏一起干掉。
    document.querySelector(".footer .setup").remove();

})();