通过 JS 脚本去除csdn广告
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广告的更多相关文章
- JS脚本实现CSDN免登陆免关闭广告插件自动展开“阅读更多”内容
最近在CSDN查资料,总是弹出以下弹窗,然后就自动跳转到登录页面,蛋疼! 于是重新捣腾了一下,修改了原来的脚本,最新的脚本代码如下: 温馨提示:在打开CSDN页面后立刻执行以下脚本即可免登陆免关闭广告 ...
- 推荐一个Chrome扩展应用,能够自动去除CSDN广告
作为一个程序员,每天编程遇到问题时,少不了前往国内著名的CSDN网站上查信息,看是否有同行遇到类似问题.很多时候根据遇到问题的错误消息进行搜索,结果都是一篇篇CSDN博客.这些博客打开后都会显示很多广 ...
- 去除CSDN 博客页广告的历程
第一招 方式1 方式2 第二招 第三招 素材准备 必备知识 代码部分 测试 总结 作为CSDN的忠实用户,我觉得它挺不错的.美中不足的是广告,虽然相比于微博啊,开源中国啊这些博客站点,它的广告已经算是 ...
- 精华 selenium_webdriver(python)调用js脚本
#coding=utf-8 from selenium import webdriver import time driver = webdriver.Firefox() driver.get(&qu ...
- CSS样式表、JS脚本加载顺序与SpringMVC在URL路径中传参数与SpringMVC 拦截器
CSS样式表和JS脚本加载顺序 Css样式表文件要在<head>中先加载,这样网页显示时可以第一次就渲染出正确的布局和样式,网页就不会闪烁,或跳变 JS脚本尽可能放在<body> ...
- JS脚本不能运行
版权声明:本文为博主原创文章.未经博主同意不得转载. https://blog.csdn.net/moqiang02/article/details/25898295 这段时间在做前端的动态页面,出了 ...
- 原创js脚本实现百度网盘任意文件强制下载
代码: //get file list data var data=require("system-core:context/context.js").instanceForSys ...
- js脚本实现在该界面直接跳转到一个登录界面并且自动登录
1:首先说明的是自动登录也是需要密码的,这是前一个网页传输过去的 2:这里我使用的是post提交表单的形式 <------------------------------------------ ...
- Firebug中调试中的js脚本中中文内容显示为乱码
Firebug中调试中的js脚本中中文内容显示为乱码 设置 页面 UFT-8 编码没用, 解决方法:点击 "Firebug"工具栏 中的"选项"---" ...
随机推荐
- Android6.0 源码修改之屏蔽导航栏虚拟按键(Home和RecentAPP)/动态显示和隐藏NavigationBar
场景分析, 为了完全实现沉浸式效果,在进入特定的app后可以将导航栏移除,当退出app后再次将导航栏恢复.(下面将采用发送广播的方式来移除和恢复导航栏) ps:不修改源码的情况下,简单的沉浸式效果实现 ...
- python语言学习---3
第四天 1.set 持有一系列元素,这一点和 list 很像,但是set的元素没有重复,而且是无序的, 这点和 dict 的 key很像. (不信可以输出下试试 ~-~ )另外,其存储的对象必须不可变 ...
- MySQL 如何查看表的存储引擎
MySQL 如何查看表的存储引擎 在MySQL中如何查看单个表的存储引擎? 如何查看整个数据库有那些表是某个特殊存储引擎,例如MyISAM存储引擎呢?下面简单的整理一下这方面的知识点. 如果要查看 ...
- 转:Redis 使用经验总结
转自:Redis 总结精讲 看一篇成高手系统-4 本文围绕以下几点进行阐述 1.为什么使用redis2.使用redis有什么缺点3.单线程的redis为什么这么快4.redis的数据类型,以及每种数据 ...
- AI学习---数据IO操作&神经网络基础
数据IO操作 TF支持3种文件读取: 1.直接把数据保存到变量中 2.占位符配合feed_dict使用 3. QueueRunner(TF中特有的) 文件读取流程 文件读取流程(多线 ...
- 将正在运行的Proxmox EV5.x版本更新到最新版本
问题描述: 最近搭建了一个KVM开源虚拟化平台 Proxmox Virtual Environment是一种基于QEMU / KVM和LXC的开源服务器虚拟化管理解决方案.您可以使用集成的,易于使用的 ...
- 枚举应用demo
package com.xx; public enum PositionEM{ ONE(1,"领导"), TWO(2,"员工"); private Long v ...
- 【大数据技术】HBase与Solr系统架构设计
如何在保证存储量的情况下,又能保证数据的检索速度. HBase提供了完善的海量数据存储机制,Solr.SolrCloud提供了一整套的数据检索方案. 使用HBase搭建结构数据存储云,用来存储海量数据 ...
- PostgreSQL条件表达式 case when then end
例: SELECT CASE WHEN (store_size <= (100)::NUMERIC) THEN '小店'::TEXT WHEN (store_size >= (200):: ...
- (转)Spring Boot(十八):使用 Spring Boot 集成 FastDFS
http://www.ityouknow.com/springboot/2018/01/16/spring-boot-fastdfs.html 上篇文章介绍了如何使用 Spring Boot 上传文件 ...