Absolute concise of PhotoBucket

Auto remove all of photobucket's advertisement popup

目前为 2018-05-06 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Absolute concise of PhotoBucket
  3. // @name:zh-TW PhotoBucket絕對簡潔
  4. // @namespace http://WWW.NTRSN.CN/
  5. // @version 0.2
  6. // @description Auto remove all of photobucket's advertisement popup
  7. // @description:zh-TW 自動删除所有PhotoBucket廣告彈窗
  8. // @author WWW.NTRSN.CN
  9. // @supportURL 873248164@qq.com
  10. // @contributionURL https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=873248164@qq.com&item_name=Greasy+Fork+donation
  11. // @include *photobucket.com*
  12. // @name Auto close photobucket's popup自动关闭photobucket广告弹窗
  13. // ==/UserScript==
  14. (function() {
  15. 'use strict';
  16. var container=document.getElementsByClassName('navbar-inner')[0];container.style.backgroundColor='#FFFFFF';
  17. var siteNav=getByClass('nav','siteNav')[0];siteNav.style.backgroundColor='#000000';
  18. var profile=getByClass('profile','nav')[0];profile.style.backgroundColor='#000000';
  19. var bannerAd=getByClass('ad','bannerAd')[0];bannerAd.style.backgroundColor='#FFFFFF';
  20. var href=window.location.href;
  21. if(href.indexOf('photobucket.com/browse')!==-1)
  22. {
  23. var pull_right=getByClass('pull-right','sidebar')[0];
  24. pull_right.parentNode.removeChild(pull_right);
  25.  
  26. }
  27. if(href.indexOf('library')!==-1)
  28. {
  29. var promoAd=getByClass('ad','promoAd')[0];
  30. promoAd.parentNode.removeChild(promoAd);
  31. for(var i=1;i<3;i++){
  32. var ad=getByClass('ad','mrec')[0];
  33. ad.parentNode.removeChild(ad);
  34. }
  35. do{
  36. CheckExist('footer',1);
  37. CheckExist('bannerAd',1);
  38. CheckExist('printPromoPushdown',1);
  39. CheckExist('tynt-sidebar-content',2);
  40. CheckExist('tynt-interstitial-body',2);
  41. CheckExist('slider-left-300x250',1);
  42. CheckExist('slider-left-160x600-frame',1);
  43. CheckExist('ii1525599797.e7cd7f8e-5111-11e8-946c-000acd2b1a6e.IM.118578',1);
  44. for(var i2=1;i2<3;i2++){
  45. CheckExist('_cm-css-reset',1);
  46. }
  47. CheckExist('00:00__cm-css-reset',1);
  48. CheckExist('pull_right_sidebar',1);
  49. CheckExist('inBtIcon',1);
  50. CheckExist('logo-container-clickOverlay',1);
  51. CheckExist('taw0',1);
  52. CheckExist('myModal',1);
  53. CheckExist('ac_148699_modal-container',1);
  54.  
  55. }
  56. while(
  57. CheckExist('footer',1)==true||
  58. CheckExist('bannerAd',1)==true||
  59. CheckExist('printPromoPushdown',1)==true||
  60. CheckExist('tynt-sidebar-content',2)==true||
  61. CheckExist('tynt-interstitial-body',2)==true||
  62. CheckExist('pull_right_sidebar',1)==true||
  63. CheckExist('slider-left-300x250',1)==true||
  64. CheckExist('slider-left-160x600-frame',1)==true||
  65. CheckExist('ii1525599797.e7cd7f8e-5111-11e8-946c-000acd2b1a6e.IM.118578',1)==true||
  66. CheckExist('_cm-css-reset',1)==true||
  67. CheckExist('00:00__cm-css-reset',1)==true||
  68. CheckExist('pull_right_sidebar',1)==true||
  69. CheckExist('inBtIcon',1)==true||
  70. CheckExist('logo-container-clickOverlay',1)==true||
  71. CheckExist('taw0',1) ==true||
  72. CheckExist('myModal',1)==true||
  73. CheckExist('ac_148699_modal-container',1) ==true
  74. );
  75. }
  76. function CheckExist(IdOrClassName,type){
  77. var ISExist;
  78. switch(type)
  79. {
  80. case 1:
  81. if(typeof(document.getElementById(IdOrClassName))!=="undefined")
  82. {
  83. Remove(IdOrClassName,1);
  84. ISExist=true;
  85. }
  86. else
  87. {
  88. ISExist=false;
  89. }
  90. break;
  91. case 1:
  92. if(typeof(document.getElementsByClassName(IdOrClassName)[0])!=="undefined")
  93. {
  94. Remove(IdOrClassName,2);
  95. ISExist=true;
  96. }
  97. else
  98. {
  99. ISExist=false;
  100. }
  101. break;
  102. }
  103. return ISExist;
  104. }
  105. function getByClass(classNameA,classNameB){
  106. var oParent=document.getElementsByClassName(classNameA);
  107. if(typeof(oParent)!=='undefined'){
  108. var result=[];
  109. for(var i=0;i<oParent.length;i++){
  110. var arr=oParent[i];//.getElementsByClassName(classNameB);
  111. if(arr.classList.contains(classNameB)==true)
  112. {
  113. result.push(arr);
  114.  
  115. /* for(var i1=0;i1<arr.classList.length;i1++)
  116. {
  117. if(arr.classList.item(i1)==classNameB)
  118. {
  119. result.push(arr.classList.item(i1));
  120. }
  121. }*/
  122. }
  123. }
  124. return result;
  125. }
  126. }
  127. function Remove(IdOrClassName,type)
  128. {
  129. var remove;
  130. switch (type){
  131. case 1:
  132. remove = document.getElementById(IdOrClassName);
  133. break;
  134. case 2:
  135. remove = document.getElementsByClassName(IdOrClassName)[0];
  136. break;
  137. }
  138. remove.parentNode.removeChild(remove);
  139. }
  140.  
  141. })();

QingJ © 2025

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