Anti-Adblock Killer on movie

Anti-Adblock Killer movie is a userscript whose functionality is removing protections used on movie sites that force the user to disable the AdBlocker.

目前为 2015-11-28 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Anti-Adblock Killer on movie
  3. // @namespace https://userscripts.org/scripts/show/155840
  4. // @description Anti-Adblock Killer movie is a userscript whose functionality is removing protections used on movie sites that force the user to disable the AdBlocker.
  5. // @author Reek | reeksite.com
  6. // @version 1.1
  7. // @license Creative Commons BY-NC-SA
  8. // @encoding utf-8
  9. // @homepage https://github.com/reek/anti-adblock-killer#anti-adblock-killer--reek
  10. // @twitter https://twitter.com/antiadbkiller
  11. // @supportURL https://github.com/reek/anti-adblock-killer/issues
  12. // @contributionURL https://github.com/reek/anti-adblock-killer#donate
  13. // @icon https://raw.github.com/reek/anti-adblock-killer/master/anti-adblock-killer-icon.png
  14. // @include http*://*
  15. // @grant unsafeWindow
  16. // @grant GM_addStyle
  17. // @grant GM_getValue
  18. // @grant GM_setValue
  19. // @grant GM_xmlhttpRequest
  20. // @grant GM_registerMenuCommand
  21. // @grant GM_deleteValue
  22. // @grant GM_listValues
  23. // @grant GM_getResourceText
  24. // @grant GM_getResourceURL
  25. // @grant GM_log
  26. // @grant GM_openInTab
  27. // @grant GM_setClipboard
  28. // @grant GM_info
  29. // @grant GM_getMetadata
  30. // @run-at document-start
  31. // ==/UserScript==
  32. /*=====================================================
  33. Thanks
  34. =======================================================
  35.  
  36. Donors: M. Howard, Shunjou, Charmine, Kierek93, G. Barnard, H. Young, Seinhor9, ImGlodar, Ivanosevitch, HomeDipo, R. Martin, DrFiZ, Tippy, B. Rohner, P. Kozica, M. Patel, W4rell, Tscheckoff, AdBlock Polska, AVENIR INTERNET, coolNAO, Ben, J. Park, C. Young
  37. Collaborators: InfinityCoding, Couchy, Dindog, Floxflob, U Bless, Watilin, @prdonahue, Hoshie, 3lf3nLi3d, Alexo, Crits, Noname120, Crt32, JixunMoe, Athorcis, Killerbadger, SMed79, Alexander255, Anonsubmitter, RaporLoLpro, Maynak00, Robotex
  38. Users: Thank you to all those who use Anti Adblock Killer, who report problems, who write the review, which add to their favorites, making donations, which support the project and help in its development or promote.
  39.  
  40. =======================================================
  41. Mirrors
  42. =======================================================
  43.  
  44. Github: http://tinyurl.com/mcra3dn
  45. Greasyfork: http://tinyurl.com/puyxrn4
  46. Openuserjs: http://tinyurl.com/nnqje32
  47. MonkeyGuts: http://tinyurl.com/ka5fcqm
  48. Userscripts: http://tinyurl.com/q8xcejl
  49.  
  50. =======================================================
  51. Documentation
  52. =======================================================
  53.  
  54. Greasemonkey: http://tinyurl.com/yeefnj5
  55. Scriptish: http://tinyurl.com/cnd9nkd
  56. Tampermonkey: http://tinyurl.com/pdytfde
  57. Violentmonkey: http://tinyurl.com/n34wn6j
  58. NinjaKit: http://tinyurl.com/pkkm9ug
  59.  
  60. =======================================================
  61. Script
  62. ======================================================*/
  63.  
  64. Aak = {
  65. name : 'Anti-Adblock Killer on movie',
  66. version : '7.9',
  67. scriptid : 'gJWEp0vB',
  68. homeURL : 'https://github.com/reek/anti-adblock-killer#anti-adblock-killer--reek',
  69. changelogURL : 'https://github.com/reek/anti-adblock-killer#changelog',
  70. donateURL : 'https://github.com/reek/anti-adblock-killer#donate',
  71. featuresURL : 'https://github.com/reek/anti-adblock-killer#features',
  72. reportURL : 'https://github.com/reek/anti-adblock-killer/wiki/Report-Guide',
  73. twitterURL : 'https://twitter.com/antiadbkiller',
  74. downloadURL : 'https://raw.githubusercontent.com/reek/anti-adblock-killer/master/anti-adblock-killer.user.js',
  75. filtersSubscribe : 'abp:subscribe?location=https://raw.github.com/reek/anti-adblock-killer/master/anti-adblock-killer-filters.txt&title=Anti-Adblock%20Killer%20|%20Filters%20for%20Adblockers',
  76. filtersURL : "https://raw.githubusercontent.com/reek/anti-adblock-killer/master/anti-adblock-killer-filters.txt",
  77. iconURL : 'https://raw.githubusercontent.com/reek/anti-adblock-killer/master/anti-adblock-killer-icon.png',
  78. debug : {
  79. log: true,
  80. dump : false,
  81. inserted : false
  82. },
  83. initialize : function () {
  84.  
  85. // Debug
  86. if (Aak.debug.dump) {
  87. Aak.log('Anti-Adblock Killer v' + Aak.getVersion() + ' on ' + Aak.getScriptManager() + ' in ' + Aak.getBrowser());
  88.  
  89. Aak.log('Aak');
  90. Aak.log(Aak);
  91. Aak.log('Local Storage');
  92. Aak.log(localStorage);
  93. //localStorage.clear();
  94. Aak.log('GM Storage');
  95. Aak.log(Aak.listValues());
  96.  
  97. Aak.log('GM API Supported');
  98. Aak.log(Aak.apiSupported());
  99. }
  100.  
  101. // Stop if user not use Script Manager or not support GM Api
  102. if (Aak.apiRequires()) {
  103. // Add Command in Greasemonkey Menu
  104. Aak.addCommands();
  105.  
  106. // Detect Filters
  107. Aak.once(30, 'aak-detectfilters', Aak.detectFilters);
  108.  
  109. // Check Update
  110. Aak.once(5, 'aak-checkupdate', Aak.update.checkAuto);
  111.  
  112. // Detect and Kill
  113. Aak.kill();
  114. }
  115. },
  116. uw : unsafeWindow || window,
  117. isTopWindow : !(window.top != window.self),
  118. ready : function (fn) {
  119. window.addEventListener('load', fn);
  120. },
  121. contains : function (string, search) {
  122. return string.indexOf(search) != -1;
  123. },
  124. log : function (msg, type) {
  125. if (Aak.debug.log) {
  126. if (typeof console === 'undefined') {
  127. console = unsafeWindow.console;
  128. }
  129. console[type || 'info']('AntiAdblockKiller: ' + msg);
  130. }
  131. },
  132. apiRequires : function () {
  133. if (typeof GM_xmlhttpRequest != 'undefined' &&
  134. typeof GM_setValue != 'undefined' &&
  135. typeof GM_getValue != 'undefined' &&
  136. typeof GM_addStyle != 'undefined' &&
  137. typeof GM_registerMenuCommand != 'undefined') {
  138. return true;
  139. } else {
  140. return false;
  141. }
  142. },
  143. apiSupported : function () {
  144. if (Aak.isTopWindow) {
  145. // GM API
  146. // Doc: http://tinyurl.com/yeefnj5
  147. return {
  148. GM_xmlhttpRequest : typeof GM_xmlhttpRequest != 'undefined',
  149. GM_setValue : typeof GM_setValue != 'undefined',
  150. GM_getValue : typeof GM_getValue != 'undefined',
  151. GM_addStyle : typeof GM_addStyle != 'undefined',
  152. GM_registerMenuCommand : typeof GM_registerMenuCommand != 'undefined',
  153. GM_info : typeof GM_info != 'undefined',
  154. GM_getMetadata : typeof GM_getMetadata != 'undefined',
  155. GM_deleteValue : typeof GM_deleteValue != 'undefined',
  156. GM_listValues : typeof GM_listValues != 'undefined',
  157. GM_getResourceText : typeof GM_getResourceText != 'undefined',
  158. GM_getResourceURL : typeof GM_getResourceURL != 'undefined',
  159. GM_log : typeof GM_log != 'undefined',
  160. GM_openInTab : typeof GM_openInTab != 'undefined',
  161. GM_setClipboard : typeof GM_setClipboard != 'undefined'
  162. }
  163. }
  164. },
  165. listValues : function () {
  166. var list = GM_listValues();
  167. var obj = {};
  168. for (var i in list) {
  169. obj[list[i]] = GM_getValue(list[i]);
  170. }
  171. return obj;
  172. },
  173. getBrowser : function () {
  174. var ua = navigator.userAgent;
  175. if (Aak.contains(ua, 'Firefox')) {
  176. return "Firefox";
  177. } else if (Aak.contains(ua, 'MSIE')) {
  178. return "IE";
  179. } else if (Aak.contains(ua, 'Opera')) {
  180. return "Opera";
  181. } else if (Aak.contains(ua, 'Chrome')) {
  182. return "Chrome";
  183. } else if (Aak.contains(ua, 'Safari')) {
  184. return "Safari";
  185. } else if (Aak.contains(ua, 'Konqueror')) {
  186. return "Konqueror";
  187. } else if (Aak.contains(ua, 'PaleMoon')) {
  188. return "PaleMoon"; // fork firefox
  189. } else if (Aak.contains(ua, 'Cyberfox')) {
  190. return "Cyberfox"; // fork firefox
  191. } else if (Aak.contains(ua, 'SeaMonkey')) {
  192. return "SeaMonkey"; // fork firefox
  193. } else if (Aak.contains(ua, 'Iceweasel')) {
  194. return "Iceweasel"; // fork firefox
  195. } else {
  196. return ua;
  197. }
  198. },
  199. getVersion : function () {
  200. return Number(Aak.version);
  201. },
  202. getScriptManager : function () {
  203. if (Aak.apiRequires()) {
  204. if (typeof GM_info == 'object') {
  205. // Greasemonkey (Firefox)
  206. if (typeof GM_info.uuid != 'undefined') {
  207. return 'Greasemonkey';
  208. } // Tampermonkey (Chrome/Opera)
  209. else if (typeof GM_info.scriptHandler != 'undefined') {
  210. return 'Tampermonkey';
  211. }
  212. } else {
  213. // Scriptish (Firefox)
  214. if (typeof GM_getMetadata == 'function') {
  215. return 'Scriptish';
  216. } // NinjaKit (Safari/Chrome)
  217. else if (typeof GM_getResourceText == 'undefined' &&
  218. typeof GM_getResourceURL == 'undefined' &&
  219. typeof GM_openInTab == 'undefined' &&
  220. typeof GM_setClipboard == 'undefined') {
  221. return 'NinjaKit';
  222. } // GreaseGoogle (Chrome)
  223. else if (Aak.getBrowser() == 'Chrome' &&
  224. typeof GM_setClipboard == 'undefined') {
  225. return 'GreaseGoogle';
  226. }
  227. }
  228. } else {
  229. Aak.log('No Script Manager detected');
  230. return false;
  231. }
  232. },
  233. generateID : function () {
  234. return 'Aak-' + Math.random().toString(36).substring(4);
  235. },
  236. generateUUID : function () {
  237. // Universally Unique IDentifier
  238. var d = new Date().getTime();
  239. var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  240. var r = (d + Math.random() * 16) % 16 | 0;
  241. d = Math.floor(d / 16);
  242. return (c == 'x' ? r : (r & 0x7 | 0x8)).toString(16);
  243. });
  244. return uuid;
  245. },
  246. getUUID : function () {
  247. // Universally Unique IDentifier
  248. var name = 'aak-uuid';
  249. if (typeof GM_getValue(name) == 'undefined') {
  250. GM_setValue(name, Aak.generateUUID());
  251. }
  252. return GM_getValue(name);
  253. },
  254. once : function (day, name, callback) {
  255. setTimeout(function () {
  256. if (typeof GM_getValue != 'undefined') {
  257. // Current time
  258. var time = new Date().getTime();
  259. // Create setValue
  260. if (isNaN(GM_getValue(name))) {
  261. GM_setValue(name, 1);
  262. }
  263. // Execute
  264. if (Number(GM_getValue(name)) < time) {
  265. GM_setValue(name, (time + (day * 24 * 60 * 60 * 1000)).toString());
  266. callback();
  267. }
  268. }
  269. }, 0);
  270. },
  271. addCommands : function () {
  272. Aak.ready(function () {
  273. // Scriptish
  274. // Note: No menu command is created when the user script is run in a iframe window.
  275. // Doc: http://tinyurl.com/kvvv7yt
  276. if (Aak.isTopWindow && typeof GM_registerMenuCommand != 'undefined') {
  277. GM_registerMenuCommand(Aak.name + ' ' + Aak.getVersion() + ' Homepage', function () {
  278. location.href = Aak.homeURL;
  279. });
  280. GM_registerMenuCommand(Aak.name + ' ' + Aak.getVersion() + ' Check Update', Aak.update.check);
  281. }
  282. });
  283. },
  284. notification : function (message, delay) {
  285. if (Aak.isTopWindow) {
  286.  
  287. // animation
  288. Aak.addStyle('@-webkit-keyframes aak-fadeInDown{0%{opacity:0;-webkit-transform:translateY(-20px)}100%{opacity:1;-webkit-transform:translateY(0)}}@keyframes aak-fadeInDown{0%{opacity:0;transform:translateY(-20px)}100%{opacity:1;transform:translateY(0)}}');
  289.  
  290. // box
  291. Aak.addStyle('#aak-notice {-webkit-animation:aak-fadeInDown .5s ease; animation:aak-fadeInDown .5s ease; padding:0px; color:#000; background-color:#fff; display:block; width:100%; position:fixed; z-index:999999; left: 0; top: 0; text-align: left; vertical-align:middle; margin:0; font-size:14px; font-family:arial; border-bottom:5px solid #DF3A32; line-height:1.2; font-variant:small-caps;}'.replace(/;/g, ' !important;'));
  292.  
  293. // navbar
  294. Aak.addStyle('#aak-notice-navbar {background-color:#DF3A32; padding:0px 20px 0px 62px; background-image:url("' + Aak.iconURL + '"); background-repeat:no-repeat; background-position:20px 3px; background-size:32px;}'.replace(/;/g, ' !important;'));
  295.  
  296. // link
  297. Aak.addStyle('.aak-navbar-link {padding:0px 5px; line-height:35px; color:#fff; display:inline-block; text-decoration:none; transform:skew(345deg, 0deg); background-color:#DF3A32; border-bottom:3px solid #DF3A32;}'.replace(/;/g, ' !important;'));
  298.  
  299. // link:hover
  300. Aak.addStyle('.aak-navbar-link:hover {color:#fff; background-color:#000; border-bottom:3px solid #fff; text-decoration:none;}'.replace(/;/g, ' !important;'));
  301.  
  302. // close
  303. Aak.addStyle('#aak-notice-close {color:#fff; float: right; margin:0px 5px; padding:10px 10px 8px 10px; text-decoration: none;}'.replace(/;/g, ' !important;'));
  304.  
  305. // brand
  306. Aak.addStyle('#aak-notice .brand {padding-right:20px; color:#fff; font-size:14px;}'.replace(/;/g, ' !important;'));
  307.  
  308. // content
  309. Aak.addStyle('#aak-notice-content {padding:5px 20px; min-height:72px;}'.replace(/;/g, ' !important;'));
  310. Aak.addStyle('#aak-notice-content a {color:#DF3A32; text-decoration:none;}'.replace(/;/g, ' !important;'));
  311. Aak.addStyle('#aak-notice-content a:hover {text-decoration:underline;}'.replace(/;/g, ' !important;'));
  312.  
  313. // remove
  314. Aak.removeElement('#aak-notice');
  315.  
  316. // create
  317. var node = document.createElement('div');
  318. node.id = 'aak-notice';
  319. node.innerHTML = '<div id="aak-notice-navbar"><b class="brand">Anti-Adblock Killer</b><a class="aak-navbar-link" title="Visit Homepage." href="' + Aak.homeURL + '">Homepage</a><a class="aak-navbar-link" title="Report issue or anti-adblock." href="' + Aak.reportURL + '">Report</a><a class="aak-navbar-link" title="See changes" href="' + Aak.changelogURL + '">Changelog</a><a class="aak-navbar-link" title="Make a donation to support the project." href="' + Aak.donateURL + '">Donate</a><a class="aak-navbar-link" title="Submit a new feature." href="' + Aak.featuresURL + '">Suggest Features</a><a class="aak-navbar-link" title="Follow on twitter." href="' + Aak.twitterURL + '">Twitter</a><a title="Close" href="javascript:void(0);" id="aak-notice-close">X</a></div><div id="aak-notice-content"><u style="font-size: 18px;">Notice:<br></u>' + message + '</div>';
  320.  
  321. // append
  322. document.documentElement.appendChild(node);
  323.  
  324. // close (manually)
  325. document.querySelector('#aak-notice-close').onclick = function () {
  326. Aak.removeElement('#aak-notice');
  327. }
  328.  
  329. // close (automatically)
  330. setTimeout(function () {
  331. Aak.removeElement('#aak-notice');
  332. }, delay);
  333.  
  334. }
  335. },
  336. detectFilters : function () {
  337. if (Aak.isTopWindow) {
  338. Aak.ready(function () {
  339. var elem = document.createElement("div");
  340. elem.id = "k2Uw7isHrMm5JXP1Vwdxc567ZKc1aZ4I";
  341. elem.innerHTML = "<br>";
  342. document.body.appendChild(elem);
  343.  
  344. setTimeout(function () {
  345. if (elem.clientHeight) {
  346. Aak.notification('It seems that you have not subscribed to the list <b>Anti-Adblock Killer - Filters for Adblockers</b>, this list is necessary for the proper functioning of Anti-Adblock Killer. <a href="' + Aak.filtersSubscribe + '" target="_blank">Subscribe</a>', 30000);
  347. console.warn("Anti-Adblock Killer: Filters for Adblockers No detected :( " + elem.clientHeight);
  348. } else {
  349. Aak.log("Anti-Adblock Killer: Filters for Adblockers detected");
  350. }
  351. }, 5000);
  352. });
  353. }
  354. },
  355. buildQuery : function (obj) {
  356. var array = [];
  357. for (var p in obj) {
  358. array.push(p + '=' + obj[p]);
  359. }
  360. return array.join('&');
  361. },
  362. update : {
  363. check : function () {
  364. if (Aak.isTopWindow) {
  365. Aak.notification('<b>Script: </b><i id="aak-update-script">Checking...</i><br/><b>List: </b><i id="aak-update-filters">Checking...</i>', 60000);
  366. setTimeout(function () {
  367. Aak.update.getLatestVerScript();
  368. Aak.update.getLatestVerFilters();
  369. }, 2000);
  370. }
  371. },
  372. checkAuto : function () {
  373. if (Aak.isTopWindow) {
  374. Aak.ready(function () {
  375. var data = {
  376. scriptid : Aak.scriptid,
  377. uuid : Aak.getUUID(),
  378. version : Aak.getVersion(),
  379. browser : Aak.getBrowser(),
  380. scriptmanager : Aak.getScriptManager()
  381. };
  382. GM_xmlhttpRequest({
  383. timeout : 10000, // 10s
  384. method : "POST",
  385. data : Aak.buildQuery(data),
  386. url : 'http://reeksite.com/php/get.php?checkupdate',
  387. headers : {
  388. "Content-Type" : "application/x-www-form-urlencoded"
  389. },
  390. onload : function (response) {
  391. var res = response.responseText;
  392. var status = response.status;
  393. var json = JSON.parse(res);
  394. Aak.log(res, status, json);
  395.  
  396. if (status == 200 && typeof json == 'object' && json.update) {
  397. Aak.downloadURL = json.url;
  398. Aak.update.check();
  399. }
  400. }
  401. });
  402. });
  403. }
  404. },
  405. getLatestVerScript : function () {
  406. GM_xmlhttpRequest({
  407. timeout : 5000, // 5s
  408. method : "GET",
  409. url : Aak.downloadURL,
  410. onload : function (response) {
  411. var res = response.responseText;
  412. var status = response.status;
  413. //Aak.log(status, res);
  414.  
  415. if (status == 200) {
  416. var verInstalled = Aak.getVersion();
  417. var verLatest = Number(res.match(/@version\s+(\d+\.\d+)/)[1]);
  418.  
  419. if (verInstalled < verLatest) {
  420. var message = ' ' + verLatest + ' available <a title="Install latest version" href="' + Aak.downloadURL + '" target="_blank">Install</a>';
  421. } else {
  422. var message = 'Up-to-date &#10004;';
  423. }
  424. } else {
  425. var message = '<i style="color:#c00;">Checking failed &#10008;</i>';
  426. }
  427.  
  428. var notification = document.querySelector('#aak-update-script');
  429. notification.innerHTML = message;
  430. },
  431. ontimeout : function () {}
  432. });
  433. },
  434. getLatestVerFilters : function () {
  435. GM_xmlhttpRequest({
  436. timeout : 5000, // 5s
  437. method : "GET",
  438. url : Aak.filtersURL,
  439. onload : function (response) {
  440. var res = response.responseText;
  441. var status = response.status;
  442. //Aak.log(status, res);
  443.  
  444. if (status == 200) {
  445. var verInstalled = Aak.getVersion();
  446. var verLatest = Number(res.match(/!\s+Version:\s+(\d+\.\d+)/)[1]);
  447.  
  448. if (verInstalled < verLatest) {
  449. var message = ' ' + verLatest + ' available <a title="Install latest version" id="aak-subscribe" href="' + Aak.filtersSubscribe + '" target="_blank">Install</a>';
  450.  
  451. } else {
  452. var message = 'Up-to-date &#10004;';
  453. }
  454. } else {
  455. var message = '<i style="color:#c00;">Checking failed &#10008;</i>';
  456. }
  457.  
  458. var notification = document.querySelector('#aak-update-filters');
  459. notification.innerHTML = message;
  460. },
  461. ontimeout : function () {}
  462. });
  463. }
  464. },
  465. autoReport : function (system, host, target) {
  466.  
  467. var host = (host) ? host : location.host;
  468. var target = (target) ? target : '';
  469. var name = 'Aak' + system;
  470.  
  471. Aak.log(system);
  472.  
  473. if (typeof localStorage != "undefined") {
  474. if (typeof localStorage[name] == "undefined") {
  475.  
  476. // Using localStorage because GM get/setValue does not work
  477. // Doc: http://tinyurl.com/8peqwvd
  478. localStorage[name] = host;
  479.  
  480. var data = {
  481. system : system,
  482. host : host,
  483. target : target
  484. };
  485. GM_xmlhttpRequest({
  486. timeout : 10000, // 10s
  487. method : "POST",
  488. data : Aak.buildQuery(data),
  489. url : 'http://reeksite.com/php/get.php?autoreport',
  490. headers : {
  491. "Content-Type" : "application/x-www-form-urlencoded"
  492. },
  493. onload : function (response) {
  494. var res = response.responseText;
  495. var status = response.status;
  496. //Aak.log(res, status);
  497. }
  498. });
  499. } else {
  500. //Aak.log('Already reported !');
  501. }
  502. } else {
  503. console.warn('Sorry! No Web Storage support.');
  504. }
  505. },
  506. setStorage : function () {
  507. if (localStorage) {
  508. // Le navigateur supporte le localStorage
  509. } else {
  510. //throw 'localStorage non supporté';
  511. }
  512. },
  513. getStorage : function () {
  514. if (localStorage) {
  515. // Le navigateur supporte le localStorage
  516. } else {
  517. //throw 'localStorage non supporté';
  518. }
  519. },
  520. kill : function () {
  521.  
  522. // Detect & Kill
  523. for (var i in Aak.rules) {
  524.  
  525. // Current
  526. var current = Aak.rules[i];
  527.  
  528. // RegExp host
  529. var reHost = new RegExp(current.host.join('|'), 'i');
  530. // If domains is
  531. if (reHost.test(location.host)) {
  532. // On all statements
  533. if (current.onAlways) {
  534. current.onAlways(); // loading
  535. window.addEventListener('DOMContentLoaded', current.onAlways); // interactive
  536. window.addEventListener('load', current.onAlways); // complete
  537. }
  538. // Add Js / Css / Cookie
  539. if (current.onStart) {
  540. current.onStart();
  541. }
  542. // When Before Script Executed
  543. if (current.onBeforeScript) {
  544. if ('onbeforescriptexecute' in document) { // Mozilla Firefox
  545. window.addEventListener('beforescriptexecute', current.onBeforeScript);
  546. }
  547. } // When After Script Executed
  548. if (current.onAfterScript) {
  549. if ('onafterscriptexecute' in document) { // Mozilla Firefox
  550. window.addEventListener('afterscriptexecute', current.onAfterScript);
  551. }
  552. }
  553. // When Window Load
  554. if (current.onEnd) {
  555. window.addEventListener('load', current.onEnd);
  556. }
  557. // When DOM Load
  558. if (current.onLoad) {
  559. window.addEventListener('DOMContentLoaded', current.onLoad);
  560. }
  561. // When DOM AttrModified
  562. if (current.onAttrModified) {
  563. window.addEventListener('DOMAttrModified', current.onAttrModified, false);
  564. }
  565. // When DOM SubtreeModified
  566. if (current.onSubtreeModified) {
  567. window.addEventListener('DOMSubtreeModified', current.onSubtreeModified, false);
  568. }
  569. // When DOM Elements are Inserted in Document
  570. if (current.onInsert) {
  571.  
  572. // Mutation Observer
  573. // Doc: http://tinyurl.com/mxxzee4
  574. // Support: http://tinyurl.com/nepn7vy
  575. if (typeof window.MutationObserver != 'undefined' ||
  576. typeof WebKitMutationObserver != 'undefined') {
  577.  
  578. // Mutation Observer
  579. var MutationObserver = window.MutationObserver || WebKitMutationObserver;
  580.  
  581. // Create an observer instance
  582. var obs = new MutationObserver(function (mutations) {
  583. // We can safely use `forEach` because we already use mutation
  584. // observers that are more recent than `forEach`. (source: MDN)
  585. mutations.forEach(function (mutation) {
  586. // we want only added nodes
  587. if (mutation.addedNodes.length) {
  588. //Aak.log(addedNodes);
  589. Array.prototype.forEach.call(mutation.addedNodes, function (addedNode) {
  590. //Aak.log(addedNode);
  591. current.onInsert(addedNode);
  592. });
  593. }
  594. });
  595. });
  596. // Observer
  597. obs.observe(document, {
  598. childList : true,
  599. subtree : true
  600. });
  601. }
  602. // Mutation Events (Alternative Solution)
  603. // Doc: http://tinyurl.com/op95rfy
  604. else {
  605. window.addEventListener("DOMNodeInserted", function (e) {
  606. current.onInsert(e.target);
  607. }, false);
  608. }
  609. }
  610. // When DOM Elements are Removed in Document
  611. if (current.onRemove) {
  612.  
  613. // Mutation Observer
  614. // Doc: http://tinyurl.com/mxxzee4
  615. // Support: http://tinyurl.com/nepn7vy
  616. if (typeof window.MutationObserver != 'undefined' ||
  617. typeof WebKitMutationObserver != 'undefined') {
  618.  
  619. // Mutation Observer
  620. var MutationObserver = window.MutationObserver || WebKitMutationObserver;
  621.  
  622. // Create an observer instance
  623. var obs = new MutationObserver(function (mutations) {
  624. // We can safely use `forEach` because we already use mutation
  625. // observers that are more recent than `forEach`. (source: MDN)
  626. mutations.forEach(function (mutation) {
  627. // we want only removed nodes
  628. if (mutation.removedNodes.length) {
  629. //Aak.log(mutation.removedNodes);
  630. Array.prototype.forEach.call(mutation.removedNodes, function (removedNode) {
  631. //Aak.log(removedNode);
  632. current.onRemove(removedNode);
  633. });
  634. }
  635. });
  636. });
  637. // Observer
  638. obs.observe(document, {
  639. childList : true,
  640. subtree : true
  641. });
  642. }
  643. // Mutation Events (Alternative Solution)
  644. // Doc: http://tinyurl.com/op95rfy
  645. else {
  646. window.addEventListener("DOMNodeRemoved", function (e) {
  647. current.onRemove(e.target);
  648. }, false);
  649. }
  650. }
  651. }
  652. }
  653. },
  654. confirmLeave : function () {
  655. window.onbeforeunload = function () {
  656. return '';
  657. };
  658. },
  659. confirmReport : function (elem) {
  660. elem.innerHTML = 'Report';
  661. elem.title = 'Report issue or anti-adblock';
  662. elem.onclick = function (e) {
  663. e.preventDefault();
  664. if (confirm("Do you want to report issue or anti-adblock")) { // Clic on OK
  665. location.href = Aak.reportURL;
  666. } else {
  667. location.href = elem.href;
  668. }
  669. }
  670. },
  671. stopScript : function (e) {
  672. e.preventDefault();
  673. e.stopPropagation();
  674. },
  675. innerScript : function (e) {
  676. return e.target.innerHTML;
  677. },
  678. addScript : function (code) {
  679. // Note: Scriptish no support
  680. if (document.head) {
  681. if (/\.js$/.test(code)) { // External
  682. document.head.appendChild(document.createElement('script')).src = code;
  683. } else { // Inline
  684. document.head.appendChild(document.createElement('script')).innerHTML = code.toString().replace(/^function.*{|}$/g, '');
  685. }
  686. }
  687. },
  688. addElement : function (str) { // ex: div.ads or span#ads
  689. if (Aak.contains(str, '.')) {
  690. var str = str.replace('.', ':className:');
  691. } else if (Aak.contains(str, '#')) {
  692. var str = str.replace('#', ':id:');
  693. }
  694. var arr = str.split(':');
  695. Aak.addScript('function() { document.documentElement.appendChild(document.createElement("' + arr[0] + '")).' + arr[1] + ' = "' + arr[2] + '"; document.querySelector("' + arr[0] + '").innerHTML = "<br>"; }');
  696. },
  697. removeElement : function (o) {
  698. if (o instanceof HTMLElement) {
  699. return o.parentNode.removeChild(o);
  700. } else if (typeof o === "string") {
  701. var elem = document.querySelectorAll(o);
  702. for (var i = 0; i < elem.length; i++) {
  703. elem[i].parentNode.removeChild(elem[i]);
  704. }
  705. } else {
  706. return false;
  707. }
  708. },
  709. getElement : function (selector) {
  710. var elem = document.querySelector(selector) || false;
  711. if (elem) {
  712. return elem;
  713. } else {
  714. return false;
  715. }
  716. },
  717. setElement : function (selector, props) {
  718. var elem = Aak.getElement(selector);
  719. if (elem) {
  720. for (p in props) {
  721. elem.setAttribute(p, props[p]);
  722. }
  723. } else {
  724. return false;
  725. }
  726. },
  727. addStyle : function (css) {
  728. GM_addStyle(css);
  729. },
  730. getStyle : function (elem, prop) {
  731. if (elem.currentStyle)
  732. return elem.currentStyle[prop];
  733. else if (window.getComputedStyle)
  734. return document.defaultView.getComputedStyle(elem, null).getPropertyValue(prop);
  735. },
  736. getCookie : function (name) {
  737. var oRegex = new RegExp("(?:; )?" + name + "=([^;]*);?");
  738. if (oRegex.test(document.cookie)) {
  739. return decodeURIComponent(RegExp["$1"]);
  740. } else {
  741. return null;
  742. }
  743. },
  744. setCookie : function (name, value, time) {
  745. var time = (time) ? time : 365 * 24 * 60 * 60 * 1000; // 1 year
  746. var expires = new Date();
  747. expires.setTime(new Date().getTime() + time);
  748. document.cookie = name + "=" + encodeURIComponent(value) + ";expires=" + expires.toGMTString() + ";path=/";
  749. },
  750. decodeURI : function (str) {
  751. return decodeURIComponent(str);
  752. },
  753. encodeURI : function (str) {
  754. return encodeURIComponent(str);
  755. },
  756. encodeHTML : function (str) {
  757. return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
  758. },
  759. decodeHTML : function (str) {
  760. return String(str).replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"');
  761. },
  762. allowfullscreen : function (elem, boolen) {
  763. var boolen = (boolen) ? boolen : true;
  764. if (typeof elem == 'string') {
  765. var elem = document.querySelector(elem);
  766. }
  767.  
  768. var parent = elem.parentNode;
  769. var clone = elem.cloneNode(true);
  770. var params = clone.querySelector('param[name="allowfullscreen"]') || false;
  771.  
  772. if (params) {
  773. params.value = boolen;
  774. }
  775. if (typeof clone.allowfullscreen != 'undefined') {
  776. clone.allowfullscreen = boolen;
  777. }
  778.  
  779. // Replace
  780. parent.replaceChild(clone, elem);
  781. },
  782. player : { // http://tinyurl.com/pb6fthj
  783. in : {
  784. node : null,
  785. html : null,
  786. tag : null,
  787. parent : null
  788. },
  789. out : {
  790. node : null,
  791. html : null,
  792. tag : null,
  793. parent : null
  794. },
  795. nameplayer : 'custom',
  796. swfvars : null,
  797. options : {
  798. method : 'replace',
  799. output : 'embed'
  800. },
  801. flashvars : {
  802. str : null,
  803. obj : {}
  804. },
  805. attributes : {
  806. wmode : 'opaque',
  807. quality : 'high',
  808. bgcolor : '#000000',
  809. type : 'application/x-shockwave-flash',
  810. pluginspage : 'http://www.adobe.com/go/getflash',
  811. allowscriptaccess : 'always', // never / always
  812. allowfullscreen : true
  813. },
  814. dom : function () {
  815. GM_registerMenuCommand(Aak.name + ' ' + Aak.getVersion() + ' swfobjects', function () {
  816. var elems = document.querySelectorAll('embed,object');
  817. for (var i = 0; i < elems.length; i++) {
  818. this.custom(elems[i]);
  819. this.log();
  820. }
  821. });
  822. },
  823. get : function (element) {
  824.  
  825. if (element instanceof HTMLElement) {
  826. this.in.node = element;
  827. } else if (typeof element == 'string') {
  828. if (/^[#\.]/.test(element)) {
  829. this.in.node = document.querySelector(element);
  830. } else {
  831. this.in.node = document.getElementById(element);
  832. }
  833. } else {
  834. throw 'Not object or embed player or invalid selector';
  835. }
  836.  
  837. this.in.html = this.getHtml(this.in.node);
  838. this.in.parent = this.in.node.parentNode;
  839. this.in.tag = this.in.node.tagName;
  840.  
  841. this.attributes.id = this.attributes.name = Aak.generateID();
  842. this.attributes.height = this.in.node.height || this.in.node.clientHeight || '100%';
  843. this.attributes.width = this.in.node.width || this.in.node.clientWidth || '100%';
  844.  
  845. if (/^(object|embed)$/i.test(this.in.tag)) {
  846.  
  847. //
  848. this.attributes.src = this.in.node.src || this.in.node.data || false;
  849. this.flashvars.str = this.in.node.flashvars || this.in.node.querySelector('param[name="flashvars"]') && this.in.node.querySelector('param[name="flashvars"]').value || false;
  850. var swfvars = !this.flashvars.str && this.in.node.data && this.in.node.data.split('?', 2) || false;
  851.  
  852. //
  853. if (swfvars) {
  854. this.attributes.src = swfvars[0];
  855. this.flashvars.str = swfvars[1];
  856. }
  857.  
  858. this.splitVars();
  859. this.joinVars();
  860. }
  861. //Aak.log(this);
  862. },
  863. custom : function (element, attributes, flashvars, options) {
  864.  
  865. //
  866. this.get(element);
  867.  
  868. //
  869. if (typeof attributes == 'object') {
  870. this.mergeObj(this.attributes, attributes);
  871. }
  872.  
  873. //
  874. if (typeof flashvars == 'object') {
  875. if (flashvars.set) {
  876. this.setVars(flashvars.set);
  877. }
  878. if (flashvars.remove) {
  879. this.removeVars(flashvars.remove);
  880. }
  881. }
  882.  
  883. //
  884. if (typeof options == 'object') {
  885. if (options.method) {
  886. this.options.method = options.method;
  887. }
  888. if (options.output) {
  889. this.options.output = options.output;
  890. }
  891. }
  892.  
  893. this.insert();
  894. //Aak.log(this);
  895. },
  896. log : function (a) {
  897. var a = (a) ? a : '';
  898. Aak.log('Aak.player ' + a + ' --> ', this);
  899. },
  900. addDownloadBtn : function () {
  901. var btn = document.createElement("p");
  902. btn.innerHTML = '<strong>Video: </strong> <a href="' + this.attributes.src + '" download>Download</a>';
  903. this.out.node.parentNode.insertBefore(btn, this.out.node);
  904. },
  905. mergeObj : function (obj1, obj2) {
  906. for (var prop in obj2) {
  907. obj1[prop] = obj2[prop];
  908. }
  909. },
  910. setVars : function (flashvars) {
  911. if (typeof flashvars == 'string') {
  912. this.flashvars.str = flashvars;
  913. this.splitVars();
  914. this.joinVars();
  915. } else if (typeof flashvars == 'object') {
  916. this.mergeObj(this.flashvars.obj, flashvars);
  917. this.joinVars();
  918. this.splitVars();
  919. }
  920. },
  921. removeVars : function (str) {
  922. var obj = this.flashvars.obj;
  923. var splits = str.split(',');
  924. for (var i = 0; i < splits.length; i++) {
  925. var k = splits[i];
  926. if (k in obj)
  927. delete obj[k];
  928. }
  929. this.flashvars.obj = obj;
  930. this.joinVars();
  931. },
  932. splitVars : function () {
  933. var str = Aak.decodeHTML(this.flashvars.str);
  934. var arr = str.split('&');
  935. var obj = {};
  936. for (var i = 0; i < arr.length; i++) {
  937. var k = arr[i];
  938. if (k != '' && k.split('=')) {
  939. var s = k.split('=');
  940. obj[s[0]] = Aak.decodeURI(s[1]);
  941. }
  942. }
  943. this.flashvars.obj = obj;
  944. },
  945. joinVars : function () {
  946. var obj = this.flashvars.obj;
  947. var arr = [];
  948. for (k in obj) {
  949. arr.push(k + '=' + Aak.encodeURI(obj[k])); // encodeURIComponent
  950. }
  951. this.flashvars.str = arr.join('&'); // &amp;
  952. },
  953. insert : function () {
  954.  
  955. //
  956. this.swfvars = [this.attributes.src, this.flashvars.str].join('?');
  957.  
  958. //
  959. switch (this.options.output) {
  960. case 'iframe':
  961. this.out.node = document.createElement('iframe');
  962. this.out.node.setAttribute('src', this.swfvars);
  963. this.out.node.setAttribute('width', this.attributes.width);
  964. this.out.node.setAttribute('height', this.attributes.height);
  965. this.out.node.setAttribute('frameborder', 0);
  966. this.out.node.setAttribute('scrolling', 'no');
  967. break;
  968. case 'tab':
  969. this.log();
  970. return GM_openInTab(this.swfvars);
  971. break;
  972. case 'html5':
  973. this.out.node = document.createElement('video');
  974. this.out.node.innerHTML = '<strong>Video not playing ? <a href="' + this.attributes.src + '" download>Download file</a> instead.</strong>';
  975. for (k in this.attributes) {
  976. if (k == 'autoplay') { // fix bug duplicate playing on firefox
  977. this.out.node.onloadstart = function () {
  978. this.play();
  979. }
  980. } else {
  981. this.out.node.setAttribute(k, this.attributes[k]);
  982. }
  983. }
  984. this.out.node.onerror = function () { // switch to plugin player
  985. Aak.player.plugin(this, {file:Aak.player.attributes.src});
  986. };
  987. break;
  988. default:
  989. this.out.node = document.createElement('embed');
  990. for (k in this.attributes) {
  991. this.out.node.setAttribute(k, this.attributes[k]);
  992. }
  993. if (this.flashvars.str) {
  994. this.out.node.setAttribute('flashvars', this.flashvars.str);
  995. }
  996. }
  997.  
  998. //
  999. this.out.html = this.getHtml(this.out.node);
  1000. this.out.tag = this.out.node.tagName;
  1001.  
  1002. //
  1003. if (this.options.output == 'inner') {
  1004. this.in.node.innerHTML = this.out.html;
  1005. } else { // replace
  1006. this.in.parent.replaceChild(this.out.node, this.in.node);
  1007. }
  1008. //this.addDownloadBtn();
  1009. this.log('done');
  1010. },
  1011. getHtml : function (node) {
  1012. var tmp = document.createElement('div');
  1013. tmp.appendChild(node.cloneNode(true))
  1014. return tmp.innerHTML;
  1015. },
  1016. getMime : function (file) {
  1017. var mime = file.match(/\.(flv|mp4|webm|ogv|ogg|mp3|mpeg|mpg|mkv|avi|mov)$/);
  1018. if (mime && mime.length == 2) {
  1019. return 'video/' + mime[1];
  1020. } else {
  1021. return 'video/mp4';
  1022. }
  1023. },
  1024. jwplayer5 : function (id, setup) {
  1025. // Jwplayer 5 (flash)
  1026. // Support: http://tinyurl.com/mjavxdr
  1027. // mp4, m4v, f4v, mov, flv, webm, aac, mp3, vorbis, hls, rtmp, youtube, aac, m4a, f4a, mp3, ogg, oga
  1028.  
  1029. this.get(id);
  1030. this.nameplayer = 'jwplayer5';
  1031. this.attributes.src = "http://player.longtailvideo.com/player5.9.swf"; // v5.9
  1032. this.attributes.src = "http://player.longtailvideo.com/player.swf"; // v5.10
  1033. this.attributes.height = setup.height || this.in.node.clientHeight || "100%";
  1034. this.attributes.width = setup.width || this.in.node.clientWidth || "100%";
  1035.  
  1036. setup.abouttext = 'Anti-Adblock Killer';
  1037. setup.aboutlink = 'https://github.com/reek/anti-adblock-killer';
  1038. this.mergeObj(this.flashvars.obj, setup);
  1039. this.flashvars.obj.controlbar = 'over';
  1040. if (setup.skin) {
  1041. this.flashvars.obj.skin = 'http://www.longtailvideo.com/files/skins/' + setup.skin + '/5/' + setup.skin + '.zip';
  1042. }
  1043. this.joinVars();
  1044. this.options.output = 'embed';
  1045. this.insert();
  1046. },
  1047. flowplayer : function (id, setup) {
  1048. // Flowplayer (flash)
  1049. // Support: mp4, flv, f4v, m4v, mov
  1050. // Config: http://tinyurl.com/na7vy7b
  1051.  
  1052. this.get(id);
  1053. this.nameplayer = 'flowplayer';
  1054. this.attributes.src = "http://releases.flowplayer.org/swf/flowplayer-3.2.18.swf";
  1055. this.attributes.height = setup.clip && setup.clip.height || this.in.node.clientHeight || "100%";
  1056. this.attributes.width = setup.clip && setup.clip.width || this.in.node.clientWidth || "100%";
  1057.  
  1058. setup.autoPlay = setup.clip && setup.clip.autostart;
  1059. setup.url = setup.clip && setup.clip.file;
  1060.  
  1061. this.flashvars.obj = {
  1062. config : JSON.stringify(setup)
  1063. };
  1064. this.flashvars.str = 'config=' + JSON.stringify(setup);
  1065. this.options.output = 'embed';
  1066. this.insert();
  1067. },
  1068. videojs : function (id, setup) {
  1069. //http://tinyurl.com/pcgx2ob
  1070. //http://tinyurl.com/nscztmm
  1071. //http://jsfiddle.net/N8Zs5/18/
  1072.  
  1073. this.get(id);
  1074. this.nameplayer = 'videoJs';
  1075.  
  1076. setup.height = setup.height || this.attributes.height;
  1077. setup.width = setup.width || this.attributes.width;
  1078. setup.type = this.getMime(setup.file || setup.src);
  1079.  
  1080. var html = '<html><head><link href="http://vjs.zencdn.net/4.8/video-js.css" rel="stylesheet"><script src="http://vjs.zencdn.net/4.8/video.js"></script></head><body><video id="my_video_1" class="video-js vjs-default-skin" controls preload="auto" width="' + setup.width + '" height="' + setup.height + '"></video><script>videojs("my_video_1",{techOrder:["flash","html5"],autoplay:true,sources:[{type:"' + setup.type + '",src:"' + setup.file + '"}]})</script></body></html>';
  1081. this.attributes.src = "data:text/html;charset=utf-8," + escape(html);
  1082. this.options.output = 'iframe';
  1083. this.insert();
  1084. },
  1085. jwplayer6 : function (id, setup) {
  1086. // Jwplayer 6 (flash)
  1087. // Config: http://tinyurl.com/lcygyu9
  1088. // Iframe: http://tinyurl.com/86agg68
  1089.  
  1090. this.get(id);
  1091. this.nameplayer = 'jwplayer6';
  1092.  
  1093. setup.primary = 'flash';
  1094. setup.height = setup.height || this.attributes.height;
  1095. setup.width = setup.width || this.attributes.width;
  1096.  
  1097. var html = '<html><head><script src="http://jwpsrv.com/library/5V3tOP97EeK2SxIxOUCPzg.js"></script></head><body><div id="myElement"></div><script>jwplayer("myElement").setup(' + JSON.stringify(setup) + ');</script></body></html>';
  1098. this.attributes.src = "data:text/html;charset=utf-8," + escape(html);
  1099. this.options.output = 'iframe';
  1100. this.insert();
  1101. },
  1102. external : function (nameplayer, id, setup) {
  1103.  
  1104. this.get(id);
  1105. this.nameplayer = 'external';
  1106.  
  1107. setup.height = setup.height || this.attributes.height;
  1108. setup.width = setup.width || this.attributes.width;
  1109.  
  1110. var encoded = btoa(JSON.stringify(setup));
  1111. this.attributes.src = 'http://reeksite.com/player/player.php?' + nameplayer + '=' + encoded;
  1112. this.options.output = 'iframe';
  1113. this.insert();
  1114. },
  1115. plugin : function (id, setup) {
  1116. // Web Player (plugin)
  1117. // VLC : http://tinyurl.com/omlzp39
  1118. // WMP :
  1119. // QT :
  1120.  
  1121. this.get(id);
  1122. this.nameplayer = 'plugin';
  1123. this.attributes.autoplay = setup.autostart || setup.autoplay || false;
  1124. this.attributes.src = setup.file || setup.src;
  1125. this.attributes.height = setup.height || this.in.node.clientHeight || "100%";
  1126. this.attributes.width = setup.width || this.in.node.clientWidth || "100%";
  1127.  
  1128. // Plugins
  1129. var plugins = [];
  1130. if (navigator.plugins && (navigator.plugins.length > 0)) {
  1131. for (var i = 0; i < navigator.plugins.length; i++) {
  1132. plugins.push(navigator.plugins[i].name);
  1133. }
  1134. var plugins = plugins.join('|');
  1135. if (Aak.contains(plugins, 'Windows Media Player')) {
  1136. this.attributes.type = "application/x-mplayer2";
  1137. this.attributes.pluginspage = 'http://www.microsoft.com/Windows/MediaPlayer/';
  1138. } else if (Aak.contains(plugins, 'VLC Web Plugin')) {
  1139. this.attributes.type = "application/x-vlc-plugin";
  1140. this.attributes.pluginspage = "http://www.videolan.org";
  1141. } else if (Aak.contains(plugins, 'QuickTime Plug-in')) {
  1142. this.attributes.type = "video/quicktime";
  1143. this.attributes.pluginspage = "http://www.apple.com/quicktime/download/";
  1144. } else {
  1145. Aak.notification('You need install VLC Web Plugin ! <a href="http://www.videolan.org/vlc/" target="_blank">Install</a>', 30000);
  1146. return false;
  1147. }
  1148. }
  1149. this.options.output = 'embed';
  1150. this.insert();
  1151. },
  1152. html5 : function (id, setup) {
  1153.  
  1154. // Video Tag (html5)
  1155. /* Note:
  1156. https://html5rocks.com/en/tutorials/video/basics/
  1157. http://www.w3schools.com/tags/tag_video.asp
  1158.  
  1159. // Test video
  1160. https://www.joomlacontenteditor.net/images/big_buck_bunny.flv
  1161. http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4
  1162. http://clips.vorwaerts-gmbh.de/big_buck_bunny.webm
  1163. http://clips.vorwaerts-gmbh.de/big_buck_bunny.ogv
  1164. */
  1165.  
  1166. this.get(id);
  1167. //this.attributes = {};
  1168. this.attributes.id = this.attributes.name = Aak.generateID();
  1169. this.attributes.height = setup.height || this.in.node.clientHeight || "100%";
  1170. this.attributes.width = setup.width || this.in.node.clientWidth || "100%";
  1171. this.attributes.src = setup.file || setup.src;
  1172. this.attributes.type = this.getMime(this.attributes.src);
  1173. this.attributes.controls = 'controls';
  1174. //this.attributes.preload = 'none';
  1175. if (setup.autostart || setup.autoplay) {
  1176. this.attributes.autoplay = 'autoplay';
  1177. }
  1178. this.options.output = 'html5';
  1179. this.insert();
  1180. }
  1181. },
  1182. rules : {
  1183. // --------------------------------------------------------------------------------------------
  1184. // Specific
  1185. // --------------------------------------------------------------------------------------------
  1186. movie_domains : {
  1187. host : ['movietv.to'],
  1188. onAlways : function () {
  1189. Aak.uw.myFunction = function () {};
  1190. // for (i in Aak.uw) { Aak.uw[i] = function () {}; }
  1191. }
  1192. },
  1193. fuckAdBlock : {
  1194. host : ['kooralive.info', 'miniup.com'],
  1195. onAlways : function () {
  1196. Aak.uw.fuckAdBlock = 1;
  1197. }
  1198. },
  1199. // --------------------------------------------------------------------------------------------
  1200. // Players
  1201. // --------------------------------------------------------------------------------------------
  1202. // --------------------------------------------------------------------------------------------
  1203. // Generic
  1204. // --------------------------------------------------------------------------------------------
  1205. generic : {
  1206. host : ['.*?'],
  1207. //onRemove : function (removedNode) {Aak.log(removedNode);},
  1208. //onSubtreeModified : function (e) {Aak.log(e.target);},
  1209. onStart : function () {
  1210. // do nothing
  1211. },
  1212. onLoad : function () {
  1213.  
  1214. /* Alternative solution
  1215. // AntiAdblock (Packer) only Zdxd
  1216. if (typeof Aak.uw.k == 'function' &&
  1217. typeof Aak.uw.h == 'function' &&
  1218. typeof Aak.uw.ShowAdbblock == 'function' &&
  1219. Aak.contains(Aak.uw.ShowAdbblock.toString(), 'warningMessage.innerHTML=text_detected()')) {
  1220.  
  1221. // Disable
  1222. Aak.uw.ShowAdbblock = function () {return;};
  1223. Aak.uw.k = function () {return;};
  1224. Aak.uw.h = function () {return;};
  1225. Aak.autoReport('AntiAdblockPackerZdxd)');
  1226. }
  1227. */
  1228.  
  1229. /*
  1230. // Adunblock - http://adunblock.com/
  1231. if (Aak.getCookie('adblock') == 1) {
  1232. Aak.setCookie('adblock', 0);
  1233. Aak.setCookie('bar_closed', 1);
  1234. }
  1235. */
  1236.  
  1237. // Better Stop Adblock
  1238. //Aak.uw.audio_file = false;
  1239. // Adbuddy
  1240. if (typeof Aak.uw.closeAdbuddy === 'function') {
  1241. Aak.uw.closeAdbuddy();
  1242. Aak.autoReport('Adbuddy');
  1243. }
  1244.  
  1245. // AdBlock Alerter (WP) Fix 10.12.2014
  1246. if (Aak.getElement('div.adb_overlay > div.adb_modal_img')) {
  1247. // Remove Alert + Allow Scroll
  1248. Aak.removeElement('div.adb_overlay');
  1249. Aak.addStyle('html,body {height:auto !important; overflow: auto !important;}');
  1250. Aak.autoReport('AdBlockAlerter');
  1251. }
  1252.  
  1253. // Unknow Anti AdBlock system
  1254. if (Aak.getElement('#blockdiv') && Aak.contains(Aak.getElement('#blockdiv').innerHTML, 'disable ad blocking or use another browser without any adblocker when you visit')) {
  1255. Aak.removeElement('#blockdiv');
  1256. }
  1257.  
  1258. // Antiblock - http://antiblock.org/
  1259. localStorage.antiblockId = false;
  1260. var styles = document.querySelectorAll('style');
  1261. for (var i in styles) {
  1262. var style = styles[i];
  1263. //Aak.log(style);
  1264. if (typeof style == "object") {
  1265. var css = style.innerHTML.replace(/[\n\r\t\s]+/g, "");
  1266. var matches = css.match(/#([0-9a-z]{4,10})\{.*position:fixed\!important;.+document\.documentElement.scrollTop\?document\.documentElement\.scrollTop:document\.body\.scrollTop.+\}#/i);
  1267. if (matches != null && matches.length == 2) {
  1268. //Aak.log(matches);
  1269. localStorage.antiblockId = matches[1];
  1270. }
  1271. }
  1272. }
  1273.  
  1274. // Anti-Adblockers
  1275. var systems = {
  1276. // Plugins WordPress
  1277. 'NoAdblock' : '(/plugins/no-adblock/|/blockBlock/blockBlock.jquery.js)',
  1278. 'WordPressAdBlockBlocker' : '/plugins/wordpress-adblock-blocker/',
  1279. 'AntiBlockBukssaAyman' : '/plugins/anti-block/',
  1280. 'BlockAlyzer' : '/plugins/blockalyzer-adblock-counter/',
  1281. 'AdBlockingDetector' : '/plugins/ad-blocking-detector/',
  1282. // Plugins Website
  1283. 'Adworkmedia' : '(adworkmedia|loxtk|contentlockingnetworks).com/gLoader.php',
  1284. 'Adscendmedia' : 'adscendmedia.com/gwjs.php',
  1285. 'FuckAdBlock' : '/fuckadblock.js',
  1286. 'jQueryAdblock' : '/jquery.adblock.js',
  1287. 'jQueryAdblockDetector' : '/jquery.adblock-detector.js',
  1288. 'AdvertisementJs' : '/advertisement.js',
  1289. 'AdvertisementJsMin' : '/advert.js',
  1290. 'AdvertisementJsSuffix' : '/advertisement([0-9]+|[\-._][a-z0-9]+)\.js',
  1291. 'AdframeJs' : '/adframe.js',
  1292. 'AntiAdBuster' : '/anti-ad-buster.js',
  1293. 'RTKAntiAdblock' : '/blockcake.js',
  1294. 'AdblockDetector' : '/AdblockDetector/handler.min.js',
  1295. 'jQueryAntiAdsBlock' : '/jquery.antiadsblock.js',
  1296. 'Adbuddy' : '/js/adbuddy.min.js',
  1297. 'AntiADsBlocker' : '/aadb/script.js'
  1298. }
  1299. var scripts = document.scripts;
  1300. for (var i = 0; i < scripts.length; i++) {
  1301. var script = scripts[i];
  1302. if (script.src) {
  1303. for (key in systems) {
  1304. if (new RegExp(systems[key], 'i').test(script.src)) {
  1305. //Aak.log(key, location.host, script.src);
  1306. Aak.autoReport(key, location.host, script.src);
  1307. break;
  1308. }
  1309. }
  1310. }
  1311. }
  1312.  
  1313. },
  1314. onInsert : function (insertedNode) {
  1315.  
  1316. // All Nodes
  1317. if (Aak.debug.inserted) {
  1318. Aak.log(insertedNode);
  1319. }
  1320. // No-Adblock - http://www.no-adblock.com/
  1321. if (insertedNode.id &&
  1322. insertedNode.id.length == 4 &&
  1323. /^[a-z0-9]{4}$/.test(insertedNode.id) &&
  1324. insertedNode.nodeName == 'DIV' &&
  1325. insertedNode.firstChild &&
  1326. insertedNode.firstChild.id &&
  1327. insertedNode.firstChild.id == insertedNode.id &&
  1328. Aak.contains(insertedNode.innerHTML, 'no-adblock.com')) {
  1329. // Remove
  1330. Aak.autoReport('No-Adblock', false, location.href);
  1331. Aak.removeElement(insertedNode);
  1332. //Aak.log(insertedNode);
  1333. }
  1334. // StopAdblock - http://stopadblock.org/downloads/
  1335. if (insertedNode.id &&
  1336. insertedNode.id.length == 7 &&
  1337. /^a[a-z0-9]{6}$/.test(insertedNode.id) &&
  1338. insertedNode.nodeName == 'DIV' &&
  1339. insertedNode.parentNode &&
  1340. insertedNode.parentNode.id &&
  1341. insertedNode.parentNode.id == insertedNode.id + '2' &&
  1342. Aak.contains(insertedNode.innerHTML, 'stopadblock.org')) {
  1343. // Remove
  1344. Aak.autoReport('StopAdBlock', false, location.href);
  1345. Aak.removeElement(insertedNode);
  1346. //Aak.log(insertedNode);
  1347. }
  1348.  
  1349. // AntiAdblock (Packer)
  1350. var reIframeId = /^(zd|wd)$/;
  1351. var reImgId = /^(xd|gd)$/;
  1352. var reImgSrc = /\/ads\/banner.jpg/;
  1353. var reIframeSrc = /(\/adhandler\/|\/adimages\/)/;
  1354.  
  1355. // Communs
  1356. if (insertedNode.id &&
  1357. reImgId.test(insertedNode.id) &&
  1358. insertedNode.nodeName == 'IMG' &&
  1359. reImgSrc.test(insertedNode.src) ||
  1360. insertedNode.id &&
  1361. reIframeId.test(insertedNode.id) &&
  1362. insertedNode.nodeName == 'IFRAME' &&
  1363. reIframeSrc.test(insertedNode.src)) {
  1364.  
  1365. // Variant 1
  1366. if (insertedNode.id == 'xd') {
  1367. Aak.autoReport('AntiAdblockPackerZdxd', false, location.href);
  1368. } // Variant 2
  1369. else if (insertedNode.id == 'gd') {
  1370. Aak.autoReport('AntiAdblockPackerWdgd', false, location.href);
  1371. }
  1372. // Remove
  1373. //Aak.log(insertedNode);
  1374. Aak.removeElement(insertedNode);
  1375. }
  1376.  
  1377. // Adunblock - http://adunblock.com/
  1378. var reId = /^[a-z]{8}$/;
  1379. var reClass = /^[a-z]{8} [a-z]{8}$/;
  1380. var reBg = /^[a-z]{8}-bg$/;
  1381. var reStyle = /top: -?[\d]+px; opacity: [\d]; visibility: visible;/;
  1382. var reMessage = /Il semblerait que vous utilisiez un bloqueur de publicité !/;
  1383.  
  1384. // Communs
  1385. if (typeof Aak.uw.vtfab != 'undefined' &&
  1386. typeof Aak.uw.adblock_antib != 'undefined' &&
  1387. insertedNode.parentNode &&
  1388. insertedNode.parentNode.nodeName == 'BODY' &&
  1389. insertedNode.id &&
  1390. reId.test(insertedNode.id) &&
  1391. insertedNode.nodeName == 'DIV' &&
  1392. insertedNode.nextSibling &&
  1393. insertedNode.nextSibling.className &&
  1394. insertedNode.nextSibling.nodeName == 'DIV') {
  1395.  
  1396. // Full Screen Message (Premium)
  1397. // <div id="lfyhsvdq" class="tvwnoqdf svonexrk" style="top: 100px; opacity: 1; visibility: visible;">
  1398. // <div class="tvwnoqdf-bg" style="display: block;"></div>
  1399. if (insertedNode.className &&
  1400. reClass.test(insertedNode.className) &&
  1401. reBg.test(insertedNode.nextSibling.className) &&
  1402. insertedNode.nextSibling.style &&
  1403. insertedNode.nextSibling.style.display != 'none') {
  1404.  
  1405. // Remove Message
  1406. Aak.autoReport("AdUnBlockPremium");
  1407. Aak.removeElement(insertedNode.nextSibling); // overlay
  1408. Aak.removeElement(insertedNode); // box
  1409. }
  1410. // Top bar Message (Free)
  1411. // <div id="vixmgrly">
  1412. // <div id="mfnhaiyx" class="lkrnvbyt">
  1413. else if (insertedNode.nextSibling.id &&
  1414. reId.test(insertedNode.nextSibling.id) &&
  1415. reMessage.test(insertedNode.innerHTML)) {
  1416.  
  1417. // Remove Message
  1418. Aak.autoReport("AdUnBlockFree");
  1419. Aak.removeElement(insertedNode);
  1420. }
  1421. }
  1422.  
  1423. // Antiblock - http://antiblock.org/
  1424. var reId = /^[a-z0-9]{4,10}$/i;
  1425. var reTag1 = /(div|span|b|i|font|strong|center)/i;
  1426. var reTag2 = /[abisuqp]{1}/i;
  1427. var reWords1 = /ad blocker|ad block|ad-block|adblocker|ad-blocker|adblock|bloqueur|bloqueador|Werbeblocker|adblockert|&#1570;&#1583;&#1576;&#1604;&#1608;&#1603; &#1576;&#1604;&#1587;/i;
  1428. var reWords2 = /kapat|disable|désactivez|désactiver|desactivez|desactiver|desative|desactivar|desactive|desactiva|deaktiviere|disabilitare|&#945;&#960;&#949;&#957;&#949;&#961;&#947;&#959;&#960;&#959;&#943;&#951;&#963;&#951;|&#1079;&#1072;&#1087;&#1088;&#1077;&#1097;&#1072;&#1090;&#1100;|állítsd le/i;
  1429.  
  1430. // Communs
  1431. if (insertedNode.parentNode &&
  1432. insertedNode.id &&
  1433. insertedNode.style &&
  1434. insertedNode.firstChild &&
  1435. !insertedNode.firstChild.id &&
  1436. !insertedNode.firstChild.className &&
  1437. reId.test(insertedNode.id) &&
  1438. reTag1.test(insertedNode.nodeName) &&
  1439. reTag2.test(insertedNode.firstChild.nodeName)) {
  1440. //Aak.log(insertedNode);
  1441. // Kill audio message
  1442. var audio = insertedNode.querySelector("audio[loop]") || false;
  1443. if (audio) {
  1444. Aak.log('Antiblock(audio)');
  1445. audio.pause();
  1446. Aak.removeElement(audio);
  1447. }
  1448. // Antiblock.org v3 + Fork
  1449. if (insertedNode.firstChild.firstChild &&
  1450. insertedNode.firstChild.firstChild.nodeName == "IMG" &&
  1451. typeof Aak.uw[insertedNode.id] == 'object' &&
  1452. typeof Aak.uw[insertedNode.id].displayMessage == 'function') {
  1453.  
  1454. // Better Stop Adblock
  1455. // Demo: http://codeclan.altervista.org/
  1456. if (typeof Aak.uw[insertedNode.id].toggle == 'function') {
  1457. var childs = document.body.childNodes;
  1458. for (var i = 0; i < childs.length; i++) {
  1459. var child = childs[i];
  1460. if (child.nodeType == 1 && child.style.display == 'none') {
  1461. child.style.display = ''; // show
  1462. //Aak.log(node);
  1463. }
  1464. }
  1465. Aak.autoReport('BetterStopAdblock');
  1466. }
  1467. // Antiblock.org v3
  1468. else {
  1469. Aak.autoReport('Antiblock3');
  1470. }
  1471. // Disable
  1472. //Aak.log(insertedNode, Aak.uw[insertedNode.id]);
  1473. Aak.removeElement(insertedNode);
  1474. Aak.uw[insertedNode.id] = false;
  1475. }
  1476. // Antiblock.org v3 + v2 (Alternative Solution)
  1477. else if (localStorage.antiblockId != false &&
  1478. insertedNode.id == localStorage.antiblockId) {
  1479. // V3
  1480. if (typeof Aak.uw[insertedNode.id] == 'object') {
  1481. Aak.uw[insertedNode.id] = false;
  1482. Aak.autoReport("Antiblock3");
  1483. } else { // V2
  1484. Aak.autoReport("Antiblock2");
  1485. }
  1486. // Disable
  1487. //Aak.log(insertedNode);
  1488. Aak.removeElement(insertedNode);
  1489. }
  1490. // Antiblock.org v2
  1491. else if (reWords1.test(insertedNode.innerHTML) &&
  1492. reWords2.test(insertedNode.innerHTML)) {
  1493. // Disable
  1494. //Aak.log(insertedNode);
  1495. Aak.autoReport("Antiblock2");
  1496. Aak.removeElement(insertedNode);
  1497. }
  1498. // Many false positive
  1499. else {
  1500. //Aak.removeElement(insertedNode);
  1501. }
  1502. }
  1503. }
  1504. }
  1505. }
  1506. };
  1507.  
  1508. Aak.initialize();