Greasy Fork is available in English.

realpython

清理realpython多余元素,便于阅读

  1. // ==UserScript==
  2. // @name realpython
  3. // @namespace http://www.jiangyixin.top/
  4. // @version 0.1
  5. // @description 清理realpython多余元素,便于阅读
  6. // @author jiangyixin
  7. // @match *://realpython.com/*
  8. // @resource https://code.jquery.com/jquery-3.3.1.min.js
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. window.onload = function() {
  15. function set_timer(name, clas) {
  16. window[name] = window.setInterval(function () {
  17. if ($(clas).length == 1) {
  18. $(clas).remove();
  19. window.clearInterval(window[name]);
  20. }
  21. }, 1000);
  22. }
  23. set_timer('share', '#at4-share');
  24. var ts = $('.sidebar-module.sidebar-module-inset.border');
  25. if (ts.length > 1) {
  26. $(ts[0]).remove();
  27. }
  28. $('.navbar.sticky-top.navbar-expand-lg.navbar-dark.flex-column').remove();
  29. $('.sidebar-module.sidebar-module-inset.p-0').remove();
  30. $('.drip-tab-container').remove();
  31. $('.card.mb-3.bg-secondary').remove();
  32. $('.col-12.rounded.p-0.w-100.mt-2.mb-4').remove();
  33. $('.mx-3.py-5.mb-5.mt-0.alert.alert-light.border.text-dark').remove();
  34. $('.sidebar-module.sidebar-module-inset.p-0.my-4').remove();
  35. $('.card.mt-4').remove();
  36. $('.footer').remove();
  37. }
  38.  
  39. })();