Bitsoup Stop Whining

Removes begspam from Bitsoup

当前为 2015-09-01 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Bitsoup Stop Whining
  3. // @namespace http://takebackbitsoup.com
  4. // @version 1.0
  5. // @description Removes begspam from Bitsoup
  6. // @include http://www.bitsoup.me/*
  7. // @include https://www.bitsoup.me/*
  8. // @run-at document-end
  9. // @author bitskewer
  10. // @match http://www.bitsoup.me/*
  11. // @match https://www.bitsoup.me/*
  12. // @locale en
  13. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
  14.  
  15. // ==/UserScript==
  16.  
  17. window.addEventListener("load", function(e) {
  18. addButton();
  19. }, false);
  20. function addButton(){
  21. $("#restoreButton").html('<input id="restoreButton" type="button" value="Begging message removed - Click here to view it" />');
  22. $("#restoreButton").bind('click', doRestore);
  23. }
  24. function doRestore() {
  25. var spam = $(".main > span:nth-child(2)");
  26. if (spam) {
  27. spam.show();
  28. $("#restoreButton").hide();
  29. }
  30. }
  31.  
  32.  
  33. var dismiss = function() {
  34. var link = $("a[href*='announcement.php']");
  35. if (link && link.attr("href")) {
  36. // jquery doesn't seem to do position absolute so use DOM directly
  37. var iframe = document.createElement('iframe');
  38. iframe.style.width = '1px';
  39. iframe.style.height = '1px';
  40. iframe.style.position = 'absolute';
  41. iframe.style.top = '10px';
  42. iframe.style.left = '10px';
  43. iframe.src = link.attr("href");
  44. document.body.appendChild(iframe);
  45. }
  46. };
  47. var spam = $(".main > span:nth-child(2)");
  48. if (spam) {
  49. spam.hide(1000);
  50. setTimeout(dismiss, 3000 + (Math.random() * 7000));
  51.  
  52. var sp1 = document.createElement("button");
  53. sp1.id = "restoreButton";
  54. $( "<button id='restoreButton'></button>" ).insertAfter(spam);
  55. }

QingJ © 2025

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