GlobalTV: Anti-Anti-AdBlocker

Misc

  1. // ==UserScript==
  2. // @name GlobalTV: Anti-Anti-AdBlocker
  3. // @namespace https://github.com/Zren/
  4. // @description Misc
  5. // @author Zren
  6. // @version 1
  7. // @match https://www.globaltv.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. function waitFor(predicate, callback) {
  12. var tick = function(){
  13. var e = predicate();
  14. if (e) {
  15. callback(e);
  16. } else {
  17. setTimeout(tick, 100);
  18. }
  19. };
  20. tick();
  21. }
  22. window.waitFor = waitFor
  23.  
  24. waitFor(function(){
  25. return typeof videoPlayer !== "undefined" && videoPlayer
  26. }, function(videoPlayer){
  27. videoPlayer.$window['abTest'] = { blockAdBlocker: false }
  28. })