隱藏百度文庫內“文檔助手”懸浮窗

隱藏百度文庫名為“文檔助手”的懸浮窗

目前為 2025-01-21 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         隐藏百度文库内“文档助手”悬浮窗
// @name:zh-TW   隱藏百度文庫內“文檔助手”懸浮窗
// @name:en    Hide "Document Assistant" Hover Window in Baidu Wenku
// @namespace    http://tampermonkey.net/
// @version      0.4.10
// @description  隐藏百度文库名为“文档助手”的悬浮窗
// @description:en Hide Baidu Wenku's hover window named "Document Assistant".
// @description:zh-TW 隱藏百度文庫名為“文檔助手”的懸浮窗
// @author      aspen138
// @match       *://wenku.baidu.com/*
// @match       *://wenku.baidu.com/?_wkts_=*
// @match       *://wenku.baidu.com/view/*
// @match       *://wenku.baidu.com/share/*
// @match       *://wenku.baidu.com/link*
// @match       *://wenku.baidu.com/aggs/*
// @match       *://wenku.baidu.com/ndPureView/*
// @grant        GM_addStyle
// @icon         https://edu-wenku.bdimg.com/v1/pc/view/NavMenu/wenku-logo-small.svg
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    GM_addStyle(`#wk-chat { display: none !important; }
                .wk-chat-modal.open { display: none !important; }
                #app-right{display:none!important}
                #right-wrapper-id{display:none!important}
                .right-chat-wrapper{display:none!important}
                .banner-wrapper{display:none!important}
                .vip-activity-content {display:none!important}
                .wkapp-wrap  {display:none!important}
                .theme-enter-wrap {display:none!important}`);
    window.onload = function () {
        document.querySelector(".editor-plugin-wrap").parentElement.removeChild(document.querySelector(".editor-plugin-wrap"))
    }


    let t = setInterval(function () {
        if ($('.chat-header .close').length > 0) {
            $('.chat-header .close').click();
        }

        if ($('.fold-page-text .btn.unfold').length > 0 && $('.fold-page-text .btn.unfold').text().indexOf('查看剩余全文') > -1) {
            $('.fold-page-text .btn.unfold').click();
        }

        if ($('.liter-head-fold-btn').length > 0 && $('.liter-head-fold-btn').text().indexOf('展开更多信息') > -1) {
            $('.liter-head-fold-btn').click();
        }
    }, 1000);

})();