Skip to content

Instantly share code, notes, and snippets.

@picasso250
Last active June 19, 2020 14:23
Show Gist options
  • Save picasso250/3603c076f2e6ce32bd8d959e58e96945 to your computer and use it in GitHub Desktop.
Save picasso250/3603c076f2e6ce32bd8d959e58e96945 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name 必应去上下广告且知乎去时间线广告且CSDN自动展开全文
// @version 1.1
// @include /^https?://cn\.bing\.com/.*$/
// @include /^https?://www\.zhihu\.com/.*$/
// @include /^https?://blog\.csdn\.net/.*$/
// @grant none
// ==/UserScript==
// 2020/06/19 增加CSDN自动展开全文功能
var host=window.location.host
if(host.indexOf("cn.bing.com")>=0){
for(var a of document.getElementsByClassName("b_ad")){
a.style.visibility="hidden"
}
}
// 知乎时间线中的广告
intervalZhihu();
function intervalZhihu(){
// 知乎是无限加载的,所以要每秒钟搞一次
removeByClass("Pc-feedAd-card");
setTimeout(intervalZhihu,1000);
}
function removeByClass(cls){
for(var a of document.getElementsByClassName(cls)){
a.style.visibility="hidden"
}
}
// CSDN 自动展开全文
for(var a of document.getElementsByClassName('hide-article-box')){
a.style.visibility="hidden"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment