CSDN-remove-obstacle

清理 CSDN 底部提示栏并展开内容

目前为 2018-11-01 提交的版本。查看 最新版本

// ==UserScript==
// @name         CSDN-remove-obstacle
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  清理 CSDN 底部提示栏并展开内容
// @icon         https://avatar.csdn.net/D/7/F/3_nevergk.jpg
// @author       sven
// @require      https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.18.2/babel.js
// @require      https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.16.0/polyfill.js
// @include      https://blog.csdn.net/*
// @include      https://bbs.csdn.net/topics/*
// @match        <$URL$>
// ==/UserScript==

var inline_src = (<><![CDATA[
    // 底部提示栏
    // const bottomBar = document.querySelector('.pulllog-box')
    // if (bottomBar instanceof window.HTMLDivElement) {
    //     bottomBar.parentElement.removeChild(bottomBar)
    // }
    // 阅读更多按钮
    const readMoreBtn = document.getElementById('btn-readmore')
    if (readMoreBtn instanceof window.HTMLAnchorElement) {
        readMoreBtn.click()
    }

    // 将正文部分宽度最大化
    // const aside = document.getElementsByTagName('aside')
    const main = document.getElementsByTagName('main')
    // if (aside && aside[0]) {
    //     aside[0].parentElement.removeChild(aside[0])
    // }
    if (main && main[0]) {
        main[0].style.width = '100%'
    }

    // 添加 style 标签
    (() => {
        const sheets = `
            .adblock,.pulllog-box,aside,.recommend-right,.tool-box {display: none !important;}
        `
        const sheet = document.createTextNode(sheets)
        const el = document.createElement('style')
        el.appendChild(sheet)
        document.getElementsByTagName('head')[0].appendChild(el)
        console.warn(el)
    })()

]]></>).toString();
var c = Babel.transform(inline_src, { presets: [ "es2015", "es2016" ] });
eval(c.code);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址