取缔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装载电脑管家的广告过滤脚本代码。



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

原文地址:https://www.cnblogs.com/blfshiye/p/4823137.html