1. chorme 浏览器

1.1 通过书签方式添加

新建书签:

在网址一栏中输入:

javascript: $(function () { $('aside .csdn-tracking-statistics').hide();$('#asideFooter').hide();$('.pulllog-box').hide();$('#dmp_ad_58').remove();$('.indexSuperise').remove();$('#btn-readmore').click();$('#adContent').hide();$('.recommend-ad-box').hide();$('.type_hot_word').hide();$('.recommend-fixed-box').hide();$('.recommend-right').hide();$('aside').remove();})

每次进入页面后,执行一下脚本即可。

1.2 js 作为插件安装

新建文件 remove_ad.user.js:

window.onload=function(){if(window.location.host=="blog.csdn.net"){var asideFooter=document.querySelector("#asideFooter");if(asideFooter!=null){asideFooter.style.visibility="hidden"}var pulllogBox=document.querySelector(".pulllog-box");if(pulllogBox!=null){pulllogBox.style.visibility="hidden"}var dmp_ad_58=document.querySelector("#dmp_ad_58");if(dmp_ad_58!=null){dmp_ad_58.style.visibility="hidden"}var indexSuperise=document.querySelector(".indexSuperise");if(indexSuperise!=null){indexSuperise.style.visibility="hidden"}var adContent=document.querySelector("#adContent");if(adContent!=null){adContent.style.visibility="hidden"}var recommendadbox=document.querySelectorAll(".recommend-ad-box");if(recommendadbox!=null){for(var i=0;i<recommendadbox.length;i++){recommendadbox[i].style.visibility="hidden"}}var type_hot_word=document.querySelector(".type_hot_word");if(type_hot_word!=null){type_hot_word.style.visibility="hidden"}var recommendRight=document.querySelector(".recommend-right");if(recommendRight!=null){recommendRight.style.visibility="hidden"}var aside=document.querySelector("aside");if(aside!=null){aside.parentNode.removeChild(aside)}document.querySelector("#btn-readmore").click()}};

打开chrome://extensions/,将脚本文件拖入即可。浏览器每次打开新页面,都会执行以上脚本。

2. Firefox 浏览器

下载并安装用户脚本管理插件 greasemonkey (油猴子),新建并编辑脚本:

// ==UserScript==
// @name 去广告
// @version 1
// @grant none
// ==/UserScript== window.onload=function(){if(window.location.host=="blog.csdn.net"){var asideFooter=document.querySelector("#asideFooter");if(asideFooter!=null){asideFooter.style.visibility="hidden"}var pulllogBox=document.querySelector(".pulllog-box");if(pulllogBox!=null){pulllogBox.style.visibility="hidden"}var dmp_ad_58=document.querySelector("#dmp_ad_58");if(dmp_ad_58!=null){dmp_ad_58.style.visibility="hidden"}var indexSuperise=document.querySelector(".indexSuperise");if(indexSuperise!=null){indexSuperise.style.visibility="hidden"}var adContent=document.querySelector("#adContent");if(adContent!=null){adContent.style.visibility="hidden"}var recommendadbox=document.querySelectorAll(".recommend-ad-box");if(recommendadbox!=null){for(var i=0;i<recommendadbox.length;i++){recommendadbox[i].style.visibility="hidden"}}var type_hot_word=document.querySelector(".type_hot_word");if(type_hot_word!=null){type_hot_word.style.visibility="hidden"}var recommendRight=document.querySelector(".recommend-right");if(recommendRight!=null){recommendRight.style.visibility="hidden"}var aside=document.querySelector("aside");if(aside!=null){aside.parentNode.removeChild(aside)}document.querySelector("#btn-readmore").click()}};

通过 JS 脚本去除csdn广告的更多相关文章

  1. JS脚本实现CSDN免登陆免关闭广告插件自动展开“阅读更多”内容

    最近在CSDN查资料,总是弹出以下弹窗,然后就自动跳转到登录页面,蛋疼! 于是重新捣腾了一下,修改了原来的脚本,最新的脚本代码如下: 温馨提示:在打开CSDN页面后立刻执行以下脚本即可免登陆免关闭广告 ...

  2. 推荐一个Chrome扩展应用,能够自动去除CSDN广告

    作为一个程序员,每天编程遇到问题时,少不了前往国内著名的CSDN网站上查信息,看是否有同行遇到类似问题.很多时候根据遇到问题的错误消息进行搜索,结果都是一篇篇CSDN博客.这些博客打开后都会显示很多广 ...

  3. 去除CSDN 博客页广告的历程

    第一招 方式1 方式2 第二招 第三招 素材准备 必备知识 代码部分 测试 总结 作为CSDN的忠实用户,我觉得它挺不错的.美中不足的是广告,虽然相比于微博啊,开源中国啊这些博客站点,它的广告已经算是 ...

  4. 精华 selenium_webdriver(python)调用js脚本

    #coding=utf-8 from selenium import webdriver import time driver = webdriver.Firefox() driver.get(&qu ...

  5. CSS样式表、JS脚本加载顺序与SpringMVC在URL路径中传参数与SpringMVC 拦截器

    CSS样式表和JS脚本加载顺序 Css样式表文件要在<head>中先加载,这样网页显示时可以第一次就渲染出正确的布局和样式,网页就不会闪烁,或跳变 JS脚本尽可能放在<body> ...

  6. JS脚本不能运行

    版权声明:本文为博主原创文章.未经博主同意不得转载. https://blog.csdn.net/moqiang02/article/details/25898295 这段时间在做前端的动态页面,出了 ...

  7. 原创js脚本实现百度网盘任意文件强制下载

    代码: //get file list data var data=require("system-core:context/context.js").instanceForSys ...

  8. js脚本实现在该界面直接跳转到一个登录界面并且自动登录

    1:首先说明的是自动登录也是需要密码的,这是前一个网页传输过去的 2:这里我使用的是post提交表单的形式 <------------------------------------------ ...

  9. Firebug中调试中的js脚本中中文内容显示为乱码

    Firebug中调试中的js脚本中中文内容显示为乱码 设置 页面 UFT-8 编码没用, 解决方法:点击 "Firebug"工具栏 中的"选项"---" ...

随机推荐

  1. (办公)重新选择一个开发工具Eclipse

    文章Eclipse内容摘抄自w3cschool的eclipse,原文地址:https://www.w3cschool.cn/eclipse/eclipse-run-configuration.html ...

  2. Hive之FAILED: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient异常

    一.场景 Hive启动不报错,当使用show functions;或create table...时报:FAILED: SemanticException org.apache.hadoop.hive ...

  3. Could not update the distribution database subscription table. The subscription status could not be changed.

    在一个测试服务器删除发布(Publication)时遇到下面错误,具体如下所示 标题: Microsoft SQL Server Management Studio   --------------- ...

  4. 大杀器:VS2017 查看或调试liunx代码(转载)

    From:https://blog.csdn.net/mumufan05/article/details/80094637 上一篇简单介绍了vs2017新建一个linux的工程,本编将介绍一下如何管理 ...

  5. 前后端分离djangorestframework——序列化与反序列化数据

    我们写好后端的代码,要把数据交给前端的展示的,这个数据以什么类型给前端呢?学到这里,我们已经知道这个数据最好是json字符串才行,因为网络间的传输,只认字符串或者二进制,字符串就是我们的数据,二进制就 ...

  6. 分布式:Dubbo与Zookeeper、SpringMVC整合和使用(负载均衡、容错)

    互联网的发展,网站应用的规模不断扩大,常规的垂直应用架构已无法应对,分布式服务架构以及流动计算架构势在必行,Dubbo是一个分布式服务框架,在这种情况下诞生的.现在核心业务抽取出来,作为独立的服务,使 ...

  7. c/c++ 网络编程与多线程 编译参数

    网络编程与多线程 编译参数 编译时要链接操作系统的pthread库 g++ -g socket01.cpp -std=c++11 -pthread 不加-pthread的话,出现下面的错误: term ...

  8. 数据挖掘---Matplotib的学习

    什么是matplotlib mat - matrix 矩阵                二维数据 - 二维图表            plot - 画图            lib - libra ...

  9. 持续代码质量管理-SonarQube-7.3部署

    Sonar 是一个用于代码质量管理的开放平台.通过插件机制,Sonar 可以集成不同的测试工具,代码分析工具,以及持续集成工具.与持续集成工具(例如 Hudson/Jenkins 等)不同,Sonar ...

  10. LeetCode算法题-Single Number(Java实现)

    这是悦乐书的第175次更新,第177篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第34题(顺位题号是136).给定一个非空的整数数组,除了一个元素外,每个元素都会出现两 ...