// ==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
// @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donghoang.nguyen@gmail.com&item_name=ABPVN Donation
// @run-at document-end
// @include http://*
// @include https://*
// @version 1.5.3
// @grant none
// @downloadURL none
// ==/UserScript==
String.prototype.startWith = function strStart(str){
return this.indexOf(str)===0;
};
String.prototype.ismatch = function (regex){
return this.match(regex)!==null;
};
function VNZ_MF(){
var hit=0;
$("a").each(function() {
var old_href=$(this).attr("href");
if(old_href!==undefined){
if(old_href.startWith("http://www.mediafire.com")){
$(this).attr("href","http://ref.abpvn.com/?"+old_href);
$(this).html($(this).html()+'
');
console.info("ABPVN: "+old_href+" -> "+$(this).attr("href"));
hit++;
}
}
});
if(hit==0){
console.info("ABPVN: Không có link mediafire nào trong topic");
}
else{
console.info("ABPVN: Đã xử lý "+hit+" link mediafire trong topic");
}
}
function AntiHayhaytv(){
$('head').append('');
}
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;
console.log("ABPVN: "+location.href+" -> "+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() {
url=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.startWith(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 (url.startWith('http://www.24h.com.vn')) {
console.info("ABPVN: Đã xóa background quảng cáo");
cTitle();
document.body.style.background = "white";
}
if (url.startWith('http://www.oni.vn')) {
cTitle();
ByPassOnivn();
}
if (url.startWith('https://www.fshare.vn/file')) {
$.alert({success: false, message: "ABPVN: Download fshare không cần đợi"});
cTitle();
FshareSkip();
}
if(url.startWith('http://www.hayhaytv.vn')){
console.info('ABPVN: Anti hayhaytv.vn');
cTitle();
AntiHayhaytv();
}
if(url.ismatch('http://www.vn-zoom.com/f../.')){
console.info("ABPVN: Xóa chuyển hướng Mediafire từ VNZ đã hoạt động");
VNZ_MF();
}
})();