CSDN免关注查看文章

无需关注博主,就可以查看csdn文章

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         CSDN免关注查看文章
// @namespace    xyz_xyz-CSDN%e5%85%8d%e5%85%b3%e6%b3%a8%e6%9f%a5%e7%9c%8b%e6%96%87%e7%ab%a0
// @version      1.0.0
// @description  无需关注博主,就可以查看csdn文章
// @author       xyz_xyz
// @match        https://blog.csdn.net/*
// @icon         https://g.csdnimg.cn/static/logo/favicon32.ico
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    const modifyArticle = () => {
        const article = document.querySelector('.article_content.clearfix');
        if (article) {
            article.style.height = 'auto';
            console.log('已修改 article_content 样式');
        }
        const mask = document.querySelector('.hide-article-box.hide-article-pos.text-center');
        if (mask) {
            mask.remove();
            console.log('已删除遮罩层');
        }
    };
    window.addEventListener('load', modifyArticle);
    const observer = new MutationObserver(modifyArticle);
    observer.observe(document.body, { childList: true, subtree: true });
})();