Distractionator

Removes annoying news and feeds from Google, DuckDuckGO, Youtube, and Quora

  1. // ==UserScript==
  2. // @name Distractionator
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Removes annoying news and feeds from Google, DuckDuckGO, Youtube, and Quora
  6. // @author You
  7. // @match https://www.youtube.com/*
  8. // @match https://duckduckgo.com/*
  9. // @match https://www.google.com/*
  10. // @match https://www.quora.com/
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. function addJQuery(callback) {
  15. var script = document.createElement("script");
  16. script.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js");
  17. script.addEventListener('load', function() {
  18. var script = document.createElement("script");
  19. script.textContent = "window.jQ=jQuery.noConflict(true);(" + callback.toString() + ")();";
  20. document.body.appendChild(script);
  21. }, false);
  22. document.body.appendChild(script);
  23. }
  24.  
  25. // the guts of this userscript
  26. function main() {
  27.  
  28. var timer = setInterval(go, 500);
  29.  
  30. function go() {
  31.  
  32. var duckduckGoNews = "#duckbar_static li a:contains(News),.js-module--news,#hdtb-msb-vis a:contains(News)";
  33. var googleNewsButton = "#hdtb-msb-vis a:contains(News)";
  34. var googleNewStories = "h3:contains(Top stories)";
  35. var youtubeFeed = ".ytd-two-column-browse-results-renderer";
  36. var quoraFeed = ".qu-display--flex";
  37. var allSelectors =
  38. duckduckGoNews + "," +
  39. googleNewsButton + "," +
  40. googleNewStories + "," +
  41. youtubeFeed + "," +
  42. quoraFeed;
  43.  
  44. // DuckDuckGO news
  45. jQ(duckduckGoNews).remove();
  46.  
  47. // Google News
  48. jQ(googleNewsButton).remove();
  49. jQ(googleNewStories).parent().parent().remove();
  50.  
  51. // Youtube
  52. jQ(youtubeFeed).remove();
  53.  
  54. // Quora
  55. jQ(quoraFeed).remove();
  56.  
  57. if(jQ(allSelectors).length) {
  58. clearInterval(window.timer);
  59. return;
  60. }
  61.  
  62. }
  63. }
  64.  
  65.  
  66. // load jQuery and execute the main function
  67. addJQuery(main);

QingJ © 2025

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