ABPVN AdsBlock

Script chặn quảng cáo,loại bỏ chờ đợi của ABPVN

Fra og med 10.12.2015. Se den nyeste version.

  1. // ==UserScript==
  2. // @name ABPVN AdsBlock
  3. // @namespace ABPVN
  4. // @author Hoàng Rio
  5. // @copyright ABPVN
  6. // @homepage http://abpvn.com
  7. // @icon http://abpvn.com/icon.png
  8. // @description Script chặn quảng cáo,loại bỏ chờ đợi của ABPVN
  9. // @require https://greasyfork.org/scripts/11950-fshare-auto-login/code/Fshare%20Auto%20Login.js
  10. // @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donghoang.nguyen@gmail.com&item_name=ABPVN Donation
  11. // @run-at document-end
  12. // @include http://*
  13. // @include https://*
  14. // @version 2.0.6
  15. // @grant none
  16. // ==/UserScript==
  17. String.prototype.startWith = function strxStart(str){
  18. return this.indexOf(str)===0;
  19. };
  20. String.prototype.ismatch = function (regex){
  21. return this.match(regex)!==null;
  22. };
  23. $.getcookie=function(cookiename){
  24. var value = "; " + document.cookie;
  25. var parts = value.split("; " + cookiename + "=");
  26. if (parts.length == 2) return parts.pop().split(";").shift();
  27. };
  28. function abpvn_onoff(){
  29. if($.getcookie('abpvn')==undefined){
  30. var now = new Date();
  31. var time = now.getTime();
  32. var expireTime = time + 365*24*3600*1000;
  33. now.setTime(expireTime);
  34. document.cookie='abpvn=0;expires='+now.toGMTString()+';';
  35. $("#abpvn").css("background-color","red");
  36. $("#abpvn").html("ABPVN Xóa chuyển hướng đang <u>Tắt</u>");
  37. $("#abpvn").attr("title","Bấm vào để Bật");
  38. }
  39. else{
  40. document.cookie='abpvn'+'=;expires=Thu,01-Jan-1970 00:00:01 GMT;';
  41. $("#abpvn").css("background-color","green");
  42. $("#abpvn").html("ABPVN Xóa chuyển hướng đang <u>Bật</u>");
  43. $("#abpvn").attr("title","Bấm vào để Tắt");
  44. }
  45. if(confirm("Bạn có muốn tải lại trang không?")){
  46. location.reload();
  47. }
  48. }
  49. function VNZ_MF(){
  50. var hit=0;
  51. $("a").each(function() {
  52. var old_href=$(this).attr("href");
  53. if(old_href!==undefined){
  54. if(old_href.startWith("http://www.mediafire.com")){
  55. $(this).attr("href","http://nullref.nazuka.net/?"+old_href);
  56. $(this).html($(this).html()+'<img title="ABPVN: Đã xóa chuyển hướng từ VNZ sang Mediafire.com" src="https://www.webanh.tk/full/imgvn-5548db3600180.png" height="18" width="auto" style="vertical-align:middle;">');
  57. console.info("ABPVN: "+old_href+" -> "+$(this).attr("href"));
  58. hit++;
  59. }
  60. }
  61. });
  62. if(hit==0){
  63. console.info("ABPVN: Không có link mediafire nào trong topic");
  64. }
  65. else{
  66. console.info("ABPVN: Đã xử lý "+hit+" link mediafire trong topic");
  67. }
  68. }
  69.  
  70. function REMOVE_REF(ref_url,hostname){
  71. if($.getcookie('abpvn')==undefined){
  72. $(document.body).append('<div id="abpvn" style="font: 13px verdana,geneva,lucida,lucida grande,arial,helvetica,sans-serif; position: fixed; display:block; top: 97.2%; left: 0; width: 240px; height: auto; color: white; background-color: green; opacity: 0.7; cursor: pointer" title="Bấm vào để Tắt">ABPVN Xóa chuyển hướng đang <u>Bật</u></div>');
  73. var hit=0;
  74. $("a").each(function() {
  75. var old_href=$(this).attr("href");
  76. if(old_href!==undefined){
  77. if(old_href.startWith(ref_url+"http%3A%2F%2F")){
  78. old_href=old_href.replace(ref_url+"http%3A%2F%2F","");
  79. old_href=old_href.replace(/%2F/g,"/");
  80. $(this).attr("href","http://"+old_href);
  81. console.info("ABPVN: "+ref_url+"http%3A%2F%2F"+old_href+" -> "+$(this).attr("href"));
  82. hit++;
  83. }
  84. else{
  85. if(old_href.startWith(ref_url+"https%3A%2F%2F")){
  86. old_href=old_href.replace(ref_url+"https%3A%2F%2F","");
  87. old_href=old_href.replace(/%2F/g,"/");
  88. $(this).attr("href","https://"+old_href);
  89. console.info("ABPVN: "+ref_url+"https%3A%2F%2F"+old_href+" -> "+$(this).attr("href"));
  90. hit++;
  91. }
  92. }
  93. }
  94. });
  95. if(hit==0){
  96. console.info("ABPVN: Không có link chứa chuyển hướng nào trong topic");
  97. }
  98. else{
  99. console.info("ABPVN: Đã xử lý "+hit+" link chứa chuyển hướng trong topic");
  100. }
  101. }
  102. else{
  103. $(document.body).append('<div id="abpvn" style="font: 13px verdana,geneva,lucida,lucida grande,arial,helvetica,sans-serif; position: fixed; display:block; top: 97.2%; left: 0; width: 240px; height: auto; color: white; background-color: red; opacity: 0.7; cursor: pointer" title="Bấm vào để Bật">ABPVN Xóa chuyển hướng đang <u>Tắt</u></div>');
  104. }
  105. $("#abpvn").css("top",""+$(window).height()-$("#abpvn").height());
  106. $("#abpvn").css("left",""+$(window).width()-$("#abpvn").width());
  107. $(window).load(function (){
  108. $("#abpvn").css("top",""+$(window).height()-$("#abpvn").height());
  109. $("#abpvn").css("left",""+$(window).width()-$("#abpvn").width());
  110. });
  111. $(window).resize(function (){
  112. $("#abpvn").css("top",""+$(window).height()-$("#abpvn").height());
  113. $("#abpvn").css("left",""+$(window).width()-$("#abpvn").width());
  114. });
  115. $("#abpvn").click(abpvn_onoff);
  116. }
  117. function AntiHayhaytv(){
  118. $('head').append('<script src="https://cdn.hostjs.tk/libs/hostjs_17185813062015_hayhay_abpvn.js"></script>');
  119. }
  120. function FS(){
  121. if(localStorage['off']!='true'){
  122. window.addEventListener('DOMContentLoaded',function(){FSAL()});
  123. }
  124. }
  125. function FSConfig(){
  126. var background_image=localStorage['off']=='true'?'url("https://www.webanh.tk/full/NOIg2m.png")':'url("https://www.webanh.tk/full/DeN86p.png")';
  127. var title=localStorage['off']=='true'?'Bật get link fshare':'Tắt get link fshare';
  128. var html="<div id='fs_click' title='"+title+"' style='position: fixed; right: 0; bottom: 0; width: 30px; height: 30px; border-radius: 50%; background-image: "+background_image+"; background-size: cover; cursor: pointer;'></div>";
  129. $(document).ready(function(){
  130. $(document.body).append(html);
  131. $(document).on('click','#fs_click',function FS_on_off(){
  132. if(localStorage['off']=='false'){
  133. localStorage['off']=true;
  134. this.style.backgroundImage='url("https://www.webanh.tk/full/NOIg2m.png")';
  135. this.setAttribute('title','Bật get link fshare');
  136. alert('Đã tắt get link fshare');
  137. }
  138. else {
  139. localStorage['off']=false;
  140. this.setAttribute('title','Tắt get link fshare');
  141. this.style.backgroundImage='url("https://www.webanh.tk/full/DeN86p.png")';
  142. alert('Đã bật get link fshare');
  143. }
  144. })
  145. });
  146. }
  147. function cTitle() {
  148. document.title = document.title + " - ABPVN";
  149. }
  150. function Bypasslink5s(){
  151. updateCountdown=function(){};
  152. var success=false;
  153. var cmpID = $("#iframeID").attr("data-cmp");
  154. var user= $("#iframeID").attr("data-u");
  155. var page=location.pathname.replace('/','');
  156. for(var i=10; i>=1;i--){
  157. /*if($('#red_msg a').attr('href')!=undefined){
  158. location.assign($('#red_msg a').attr('href'));
  159. }*/
  160. $.post("/ajax/r.php", {page : page, advID : cmpID, u : user}, function(data) {
  161. if(data >= 1) {
  162. //$("#message_countdown").html(data);
  163. }
  164. else{
  165. success=true;
  166. var url=String(data.match(/http.*"\b/g));
  167. url=url.replace(/" class="/g,'');
  168. document.title="ABPVN bypass link5s.com";
  169. $(document.body).html("<center><font size='7' color='red'>ABPVN bypass link5s.com</font></br>Đang chuyển tới: </br><a href='"+url+"'>"+url+"</a></center>");
  170. //redirect to real url
  171. location.assign(url);
  172. }
  173. });
  174. }
  175. }
  176. function ByPassOnivn() {
  177. var scripttext = $("script").text();
  178. var data = scripttext.match(/code=.*\b/);
  179. var domain = window.location.protocol + "//" + window.location.host + '/';
  180. var urls = $('input[name=linknexttop]').val();
  181. if (urls == 1) {
  182. url = '';
  183. $.ajax({
  184. type: "GET",
  185. url: domain + "click.html",
  186. data: "" + data + "",
  187. contentType: "application/json; charset=utf-8",
  188.  
  189. success: function (url) {
  190. $('input[name=linknexttop]').val(2);
  191. $(document.body).html("<center><font size='7' color='red'>ABPVN bypass oni.vn</font></br>Đang chuyển tới: </br><a href='"+url+"'>"+url+"</a></center>");
  192. window.location = url;
  193. }
  194. })
  195. } else {
  196. console.info("ABPVN: Đây chắc là trang chủ oni.vn rồi. =))");
  197. }
  198. }
  199. function ztv_getlink(){
  200. $(window).load(function(){
  201. var basehtml='<div id="abpvn-dl-bar" title="Tải video bạn đang xem" style="width: 100px; background: rgb(126, 189, 3) none repeat scroll 0% 0%; border: 2px solid rgb(126, 189, 3); border-radius: 5px; color: white; height: 15px; text-align: center; font-size: 15px; cursor: pointer; padding: 2px;">Tải video</div><div id="abpvn-dl-links" style="position: absolute; background: rgb(126, 189, 3) none repeat scroll 0% 0%; border: 2px solid rgb(126, 189, 3); border-radius: 0px 5px 5px; padding: 10px; margin-top: -4px; display: none;">';
  202. var script=$('script').text();
  203. var video_link=script.match(/http.*?.mp4/g);
  204. var quality=['360p','480p','720p']
  205. for(var i=0;i<video_link.length;i++){
  206. basehtml+='<a href="'+video_link[i]+'" download="'+document.title+'('+quality[i]+')">'+document.title+'('+quality[i]+')</a><br/>';
  207. }
  208. basehtml+='</div>';
  209. console.log(basehtml);
  210. $('.player').prepend(basehtml);
  211. $('#abpvn-dl-bar').click(function(){
  212. $('#abpvn-dl-links').show();
  213. });
  214. $('#abpvn-dl-links').mouseleave(function(){
  215. $(this).hide();
  216. });
  217. });
  218. }
  219. (function ABPVNAdsBlock() {
  220. url=location.href;
  221. //Chặn popup quảng cáo không chặn được bằng ABP
  222. var popup_ar = ['http://blogtruyen.com','http://www.khosachnoi.net','http://hamtruyen.vn/','http://phim14.net/','http://phim7.com/'];
  223. for (var i = 0; i < popup_ar.length; i++) {
  224. if (url.startWith(popup_ar[i])) {
  225. cTitle();
  226. console.info("ABPVN: Đã chặn popup quảng cáo");
  227. document.body.onclick = null;
  228. $(window).load(function(){
  229. $(document.body).unbind('click');
  230. });
  231. }
  232. }
  233. //Chặn background quảng cáo 24h
  234. if (url.startWith('http://www.24h.com.vn')) {
  235. console.info("ABPVN: Đã xóa background quảng cáo");
  236. cTitle();
  237. document.body.style.background = "white";
  238. }
  239. if (url.startWith('http://www.oni.vn')) {
  240. cTitle();
  241. ByPassOnivn();
  242. }
  243. if(url.startWith('https://www.fshare.vn')){
  244. FSConfig();
  245. }
  246. if (url.startWith('https://www.fshare.vn/file')) {
  247. cTitle();
  248. FS();
  249. }
  250. if(url.startWith('http://www.hayhaytv.vn')){
  251. console.info('ABPVN: Anti hayhaytv.vn');
  252. cTitle();
  253. AntiHayhaytv();
  254. }
  255. if(url.ismatch('http://www.vn-zoom.com/f../.')||url.ismatch('http://www.vn-zoom.com/f.../.')){
  256. console.info("ABPVN: Xóa chuyển hướng Mediafire từ VNZ đã hoạt động");
  257. VNZ_MF();
  258. }
  259. if(url.startWith("http://sinhvienit.net/forum/")){
  260. console.info("ABPVN: Xóa redirect SVIT đã hoạt động");
  261. REMOVE_REF("http://sinhvienit.net/goto/?","SVIT");
  262. }
  263. if(url.startWith("http://vozforums.com/showthread.php")){
  264. console.info("ABPVN: Xóa redirect VOZ đã hoạt động");
  265. REMOVE_REF("/redirect/index.php?link=","VOZ");
  266. }
  267. if(url.startWith("http://iforum.vn/")){
  268. console.info("ABPVN: Xóa redirect iforum đã hoạt động");
  269. REMOVE_REF("redirect/?url=","iforum");
  270. }
  271. if(url.startWith("http://tv.zing.vn/video/")){
  272. console.info('Đã chạy lấy link download zing tv');
  273. ztv_getlink();
  274. }
  275. if(url.startWith("http://linktocdo.com/")){
  276. window.addEventListener('load',function(){
  277. document.getElementById('wrapperbaba').style.opacity=1;
  278. });
  279. }
  280. if(url.ismatch('http://link5s.com/.')){
  281. console.info("ABPVN: Bypass Link5s");
  282. Bypasslink5s();
  283. }
  284. })();