Greasy Fork

Greasy Fork is available in English.

ABPVN AdsBlock

Script chặn quảng cáo,Bypass Oni.vn,Bypass Wait Fshare.vn của ABPVN

当前为 2015-04-29 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        ABPVN AdsBlock
// @namespace   ABPVN
// @author      Hoàng Rio
// @copyright   ABPVN
// @homepage    http://abpvn.com
// @icon        http://abpvn.com/icon.png
// @description Script chặn quảng cáo,Bypass Oni.vn,Bypass Wait Fshare.vn của ABPVN
// @include     http://*
// @include     https://*
// @version     1.4.4
// @grant       none
// ==/UserScript==
function urlStart(str){
    var url=this.location.href;
    if(url.indexOf(str)===0) return true;
    return false;
}
function AntiHayhaytv(){
    $('head').append('<script src="http://webanh.tk/cdn/hayhay_abpvn.js"></script>');
}
function FshareSkip() {
	var scripttext=$("script").text();
	var temp1=''+scripttext.match(/'.*'\n/);
	var temp2=temp1.replace("'","");
	var temp3=temp2.replace(/\n/g,"");
	var code=temp3.replace("'","");
    var speed = $(this).data('speed');
    var data = { 
	speed: speed,	
	fs_csrf: code
    };
    $.post('/download/index', data).done(function (data, statusText, xhr) {
        window.location = data.url;
    }).fail(function(xhr, statusText, error){
			 $.alert({success: false, message: "ABPVN: Đã có lỗi fshare hoặc file có password"});
    });
}
function cTitle() {
    document.title = document.title + " - ABPVN";
}
function ByPassOnivn() {
    var scripttext = $("script").text();
    var data = scripttext.match(/code=.*\b/);
    var domain = window.location.protocol + "//" + window.location.host + '/';
    var urls = $('input[name=linknexttop]').val();
    if (urls == 1) {
        url = '';
        $.ajax({
            type: "GET",
            url: domain + "click.html",
            data: "" + data + "",
            contentType: "application/json; charset=utf-8",

            success: function (html) {
                $('input[name=linknexttop]').val(2);
                window.location = html;
            }
        })
    } else {
        console.info("ABPVN: Đây chắc là trang chủ oni.vn rồi. =))");
    }
}
(function ABPVNAdsBlock() {

    //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 (urlStart(popup_ar[i])) {
            cTitle();
            console.info("ABPVN: Đã chặn popup quảng cáo");
            document.body.onclick = null;
        }
    }
    //Chặn background quảng cáo 24h
    if (urlStart('http://www.24h.com.vn')) {
        console.info("ABPVN: Đã xóa background quảng cáo");
        cTitle();
        document.body.style.background = "white";
    }
    if (urlStart('http://www.oni.vn')) {
        cTitle();
        ByPassOnivn();
    }
    if (urlStart('https://www.fshare.vn/file')) {
        $.alert({success: false, message: "ABPVN: Download fshare không cần đợi"});
        cTitle();
        FshareSkip();
    }
    if(urlStart('http://www.hayhaytv.vn')){
        console.info('ABPVN: Anti hayhaytv.vn');
        cTitle();
        AntiHayhaytv();
    }
})();