绕过CSDN"关注博主即可阅读全文"
// ==UserScript==
// @name CSDN取消"关注博主才可阅读全文"限制
// @namespace http://tampermonkey.net/
// @version 0.1.1
// @description 绕过CSDN"关注博主即可阅读全文"
// @author smartfish
// @match *://*.csdn.net/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=greasyfork.org
// @grant none
// @license MIT
// ==/UserScript==
(function() {
'use strict';
let t = setInterval(function () {
//设定循环定时器,1000毫秒=1秒,1秒钟检查一次目标对象是否出现
let articleContent = document.querySelector('#article_content'); //声明要查询的对象
let hideAarticleBox = document.getElementsByClassName('hide-article-box')[0]
console.log("will check the articleContent----",articleContent)
console.log("will check the hideAarticleBox----",hideAarticleBox)
if (articleContent && hideAarticleBox) {
console.log("will change the style----")
//判断对象是否存在,存在则开始设置值
articleContent.style.height = 'auto'
articleContent.style.overflow = 'hidden'
hideAarticleBox.style.display = 'none'
clearInterval(t); //清除循环定时器
}
}, 1000);
// Your code here...
})();