Created
October 11, 2016 17:10
-
-
Save frankyxhl/83708250dca1dc81affbdc9eacc0bc46 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name RemoveAdsOnSalangane-books | |
// @namespace salangane_books | |
// @author Frank_Xu | |
// @include http://salangane-books.com/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
// 本脚本去掉海燕烦人的广告 | |
function removeDivByClassName(className) { | |
// 找到对应的元素 | |
var elmComent = document.getElementsByClassName(className); | |
// 循环删除掉 | |
while (elmComent.length>0){ | |
elmComent[0].parentNode.removeChild(elmComent[0]); | |
} | |
} | |
window.addEventListener ("DOMContentLoaded", function() { | |
// 去掉顶部广告 | |
removeDivByClassName("wp a_t"); | |
// 去掉用户评论处的广告 | |
removeDivByClassName("plc plm"); | |
// 去掉侧边栏的广告 | |
removeDivByClassName("a_pr"); | |
// 去掉干扰码 | |
removeDivByClassName("jammer"); | |
}, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment