1
0
mirror of https://gitee.com/bitdance-team/chrome-extension synced 2025-01-31 07:20:26 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

25 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// console.log("[BitDance extension] 学生助手插件 - 删除谷歌广告模块加载成功");
// window.onload = () => {
// // 基本上 background_preventAdsScript.js 可以在源头拦截所有广告,所以下面的代码正常情况可以不用,除非用户未授权所需权限
// // 谷歌广告的通用特性是几层ins中间包含iframe最外层ins有adsbygoogle这个class所以上来就给他干掉
// var insList = document.getElementsByTagName("ins");
// for (var i = insList.length - 1; i >= 0; i--) {
// ins = insList[i];
// if (ins.classList.contains("adsbygoogle")) {
// console.log("发现google广告ins容器删除");
// ins.parentNode.removeChild(ins);
// }
// }
// // 如果不含ins但是能够断定是广告iframe也干掉他
// var iframes = document.getElementsByTagName("iframe");
// for (var i = iframes.length - 1; i >= 0; i--) {
// if (iframes[i].src.indexOf("googleads.g.doubleclick.net") > -1) {
// console.log("发现google广告删除");
// iframes[i].parentNode.removeChild(iframes[i]);
// }
// }
// }