Greasy Fork is available in English.

去除电信运营商劫持广告

去除中国电信等运营商的劫持内嵌广告

Verzia zo dňa 08.06.2017. Pozri najnovšiu verziu.

// ==UserScript==
// @name         去除电信运营商劫持广告
// @namespace    hoothin
// @version      0.1
// @description  去除中国电信等运营商的劫持内嵌广告
// @author       hoothin
// @include      http://*/*
// @run-at       document-body
// @grant        none
// @license      MIT License
// ==/UserScript==

(function() {
    'use strict';
    [].every.call(document.querySelectorAll("iframe"),function(i){
        if(i.src.indexOf(location.href)!=-1){
            console.info("检测到劫持广告!");
            //alert("检测到劫持广告!");
            i.onload=function(){
                document.querySelector("html").innerHTML=i.contentWindow.document.querySelector("html").innerHTML;
            };
            return false;
        }
        return true;
    });
})();