zoukankan      html  css  js  c++  java
  • 取缔Chrome装载电脑管家的广告过滤脚本代码

    今天Chrome调试脚本。加载在下面的脚本中找到的内容:


    /*
    电脑管家chrome 广告过滤
    */
    
    var GJAD_CS =
    {
        elemhideElt : null,
        setElemhideCSSRules: function (selectors)
        {
          if (GJAD_CS.elemhideElt && GJAD_CS.elemhideElt.parentNode)
            GJAD_CS.elemhideElt.parentNode.removeChild(GJAD_CS.elemhideElt);
    
          if (!selectors)
            return;
    
          GJAD_CS.elemhideElt = document.createElement("style");
          GJAD_CS.elemhideElt.setAttribute("type", "text/css");
    
          // Try to insert the style into the <head> tag, inserting directly under the
          // document root breaks dev tools functionality:
          // http://code.google.com/p/chromium/issues/detail?id=178109
          (document.head || document.documentElement).appendChild(GJAD_CS.elemhideElt);
    
          var elt = GJAD_CS.elemhideElt;  // Use a local variable to avoid racing conditions
          function setRules()
          {
            if (!elt.sheet)
            {
              // Stylesheet didn't initialize yet, wait a little longer
              window.setTimeout(setRules, 0);
              return;
            }
    
            elt.innerText = selectors;
          }
          setRules();
        },
        
        QueryCss: function()
        {
            var query_param={
            "url":  window.location.href
            };
    
            chrome.extension.sendRequest({cmd: "query_css", json: JSON.stringify(query_param)}, function(response)
            {
              if (response && response.selectors != "")
              {
                GJAD_CS.setElemhideCSSRules(response.selectors);
              }
            });
        },
    };
    
    GJAD_CS.QueryCss();
    
    
    左键单击浏览器右上角的电脑管理图标

    都是未开启状态,怎么还会载入那些脚本文件呢!

    右键单击浏览器右上角的电脑管理图标,管理

    把“已启用”前的勾去掉

    再刷新须要调试的页面,“Content scripts”中的脚本都不见了。

    成龚禁令Chrome装载电脑管家的广告过滤脚本代码。



    版权声明:本文博主原创文章,博客,未经同意不得转载。

  • 相关阅读:
    redis数据同步之redis-shake
    spring拦截机制中Filter(过滤器)、interceptor(拦截器)和Aspect(切面)的使用及区别
    MySQL之MVCC与幻读
    Notepad
    mac环境,python+selenium环境搭建,解决chromedriver报错问题
    大规模抓取的抓取效率和抓取技巧问题
    安卓逆向8,解决app抓包抓不到的问题
    [loj6033]棋盘游戏
    [ccBB]Billboards
    [loj6051]PATH
  • 原文地址:https://www.cnblogs.com/blfshiye/p/4823137.html
Copyright © 2011-2022 走看看