SC2Casts.com Adblock Nag Screen Remover

Removes the 'disable Adblock' nag screen.

当前为 2016-05-16 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name SC2Casts.com Adblock Nag Screen Remover
  3. // @namespace http://lazy.artifact
  4. // @version 0.24
  5. // @description Removes the 'disable Adblock' nag screen.
  6. // @author Lazy Artifact
  7. // @match http://sc2casts.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. //hi santah!! :-)
  13.  
  14. var showSignUpElements = document.querySelectorAll('[onclick="showSignUp()"]'),
  15. playAllElement,
  16. char,
  17. i,
  18. j,
  19. youTube =
  20. {
  21. url: 'https://www.youtube.com/watch_videos?video_ids=',
  22. videoIds: [],
  23. videoElements: document.querySelectorAll('iframe#ytplayer')
  24. };
  25.  
  26. //remove nag screen
  27. window.showPopup = null;
  28.  
  29. if(youTube.videoElements.length < 1) {
  30. return;
  31. }
  32.  
  33. //get YouTube video Ids
  34. for(i = 0; i < youTube.videoElements.length; i++) {
  35. youTube.videoIds[i] = '';
  36.  
  37. for(j = youTube.videoElements[i].src.lastIndexOf('/') + 1, char = youTube.videoElements[i].src[j]; char !== '?'; j++, char = youTube.videoElements[i].src[j]) {
  38.  
  39. youTube.videoIds[i] += char;
  40.  
  41. }
  42.  
  43.  
  44. }
  45.  
  46. //remove signup popup listener and add a new play all click event
  47. for(i = 0; i < showSignUpElements.length; i++) {
  48.  
  49. if(showSignUpElements[i].textContent && showSignUpElements[i].textContent === 'Play all') {
  50.  
  51. playAllElement = showSignUpElements[i];
  52. playAllElement.removeAttribute('onclick');
  53. break;
  54. }
  55.  
  56. }
  57.  
  58. youTube.url += youTube.videoIds.join(',');
  59.  
  60. playAllElement.addEventListener('click', function() {
  61. window.open(youTube.url, '_blank');
  62. }, false);
  63.  
  64. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址