ABPVN AdsBlock

Script chặn quảng cáo của ABPVN

Versión del día 09/04/2015. Echa un vistazo a la versión más reciente.

// ==UserScript==
// @name        ABPVN AdsBlock
// @namespace   ABPVN
// @author      Hoàng Rio
// @homepage    http://abpvn.com
// @icon        http://abpvn.com/icon.png
// @description Script chặn quảng cáo của ABPVN
// @include     http://*
// @include     https://*
// @version     1.0
// @grant       none
// ==/UserScript==
(function ABPVNAdsBlock(){
   if (typeof String.prototype.startsWith != 'function') {
		String.prototype.startsWith = function (str){
		return this.slice(0, str.length) == str;
		};
		}
  
  var url=this.location.href;
  //Chặn popup quảng cáo không chặn được bằng ABP
  var popup_ar=['http://blogtruyen.com'];
  for(var i=0;i<popup_ar.length;i++){
     if(url.startsWith(popup_ar[i])){
       console.info("Đã chặn popup quảng cáo");
         document.body.onclick= function(){
			 //Function xóa popup quảng cáo của ABPVN
		 };
     }
  }
  //Chặn background quảng cáo 24h
  if(url.startsWith('http://www.24h.com.vn')){
    console.info("Đã xóa background quảng cáo");
    document.body.style.background="white";
  }
})();