// ==UserScript== // @name ABPVN AdsBlock // @namespace ABPVN // @author ABPVN // @copyright ABPVN // @homepage http://abpvn.com // @supportURL https://github.com/abpvn/abpvn/issues // @icon http://abpvn.com/icon.png // @description Script chặn quảng cáo,loại bỏ chờ đợi 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 2.2.5.5 // @noframes // @change-log Block popup phimnhanh.com // @grant none // @downloadURL none // ==/UserScript== /* String Prototype */ String.prototype.startWith = function strxStart(str) { return this.indexOf(str) === 0; }; String.prototype.ismatch = function (regex) { return this.match(regex) !== null; }; var getAllText = function (selector) { var text = ''; var list = document.querySelectorAll(selector); if (list) for (var i = 0; i < list.length; i++) { text += list[i].innerText; } return text; }; var removeDuplicates = function (arr) { var tmp = [ ]; for (var i = 0; i < arr.length; i++) { if (tmp.indexOf(arr[i]) == - 1) { tmp.push(arr[i]); } } return tmp; }; //Bypass Class var byPass = { hideLinkUnlock: function () { var contentDiv = document.querySelectorAll('.onp-sl-content,.onp-locker-call'); if (contentDiv.length) { ABPVN.cTitle(); //Add style tag to hide all .onp-sl and show all .onp-sl-content if (!document.getElementById('abpvn_style')) { var style = document.createElement('style'); style.id = 'abpvn_style'; style.innerHTML = '.onp-sl-content{display:block!important;}.onp-sl{display:none!important;}'; document.body.appendChild(style); } //ShowALl ContentDiv for (var i in contentDiv) { if (contentDiv[i].firstChild && contentDiv[i].firstChild.innerText != 'Unlocked by ABPVN.COM') { var creditDiv = document.createElement('div'); creditDiv.innerHTML = 'Unlocked by ABPVN.COM'; creditDiv.style.textAlign = 'right'; contentDiv[i].insertBefore(creditDiv, contentDiv[i].firstChild); } if(contentDiv[i].style){ contentDiv[i].style.display = 'block'; } } //Hide All LockDiv var lockDiv = document.querySelectorAll('.onp-sl'); for (var j in lockDiv) { if(lockDiv[j].style){ lockDiv[j].style.display = 'none !important'; } } } }, init: function () { window.addEventListener('DOMContentLoaded', this.hideLinkUnlock); window.addEventListener('load', this.hideLinkUnlock); this.hideLinkUnlock(); } }; //Logger Class var Logger = { info: function (text) { console.info('ABPVN Info: ', text); }, warn: function (text) { console.warn('ABPVN Warn: ', text); }, error: function (text) { console.error('ABPVN Error: ', text); }, log: function (text) { console.log('ABPVN Log: ', text); }, }; //get Link class var getLink = { FShareConfig: function () { if (this.url.startWith('https://www.fshare.vn')) { var background_image = localStorage.off == 'true' ? 'url("http://i.imgur.com/kJnOMOB.png")' : 'url("http://i.imgur.com/2b7fN6a.png")'; var title = localStorage.off == 'true' ? 'Bật get link fshare' : 'Tắt get link fshare'; var html = '
'; $(document).ready(function () { $(document.body).append(html); $(document).on('click', '#fs_click', function FS_on_off() { if (localStorage.off != 'true') { localStorage.off = true; this.style.backgroundImage = 'url("http://i.imgur.com/kJnOMOB.png")'; this.setAttribute('title', 'Bật get link fshare'); alert('Đã tắt get link fshare'); } else { localStorage.off = false; this.setAttribute('title', 'Tắt get link fshare'); this.style.backgroundImage = 'url("http://i.imgur.com/2b7fN6a.png")'; alert('Đã bật get link fshare'); } }); }); } }, FShareGetLink: function () { if (this.url.startWith('https://www.fshare.vn/file/')) { if (localStorage.off != 'true') { console.info('Start get link Fshare.vn'); $(document).ready(function () { var checkpassword = document.querySelector('.fa-lock'); var linkcode = $('[data-linkcode]').attr('data-linkcode'); if (checkpassword === null) { var code = $('input[name=fs_csrf]').val(); var speed = $(this).data('speed'); var data = { 'fs_csrf': code, 'DownloadForm[pwd]': '', 'DownloadForm[linkcode]': linkcode, 'ajax': 'download-form', 'undefined': 'undefined' }; $.post('/download/get', data).done(function (data, statusText, xhr) { if (data.url === undefined) location.reload(); else { if (typeof location != 'undefined') { console.log('ABPVN: ' + location.href + ' -> ' + data.url); location.href = data.url; } else { $('.policy_download').prepend('' ); } } }).fail(function (xhr, statusText, error) { $.alert({ success: false, message: 'ABPVN: Đã có lỗi fshare hoặc file có password' }); }); } else { $.alert({ success: false, message: 'ABPVN: Hãy nhập mật khẩu cho file trước' }); $('#download-form').unbind('submit'); $('#download-form').submit(function (event) { var pwd = $('#DownloadForm_pwd').val(); var code = $('input[name=fs_csrf]').val(); var speed = $(this).data('speed'); var data = { 'fs_csrf': code, 'DownloadForm[pwd]': pwd, 'DownloadForm[linkcode]': linkcode, 'ajax': 'download-form', 'undefined': 'undefined' }; $.post('/download/get', data).done(function (data, statusText, xhr) { if (data.url === undefined) location.reload(); else { if (typeof location != 'undefined') { console.log('ABPVN: ' + location.href + ' -> ' + data.url); location.href = data.url; } else { $('.policy_download').prepend('' ); } } }).fail(function (xhr, statusText, error) { $.alert({ success: false, message: 'ABPVN: Đã có lỗi fshare hoặc file có password' }); }); event.preventDefault(); }); } }); } else { $('.policy_download').prepend('' ); } } }, mediafire_com: function () { if (this.url.startWith('http://www.mediafire.com/file/')) { var a_tag = document.querySelector('.download_link a'); var link = a_tag.getAttribute('href'); if (link.startWith('http')) { document.body.innerHTML = '