Leetcode Notes remove

Remove Lettcode Notes.

  1. // ==UserScript==
  2. // @name Leetcode Notes remove
  3. // @namespace http://www.cocong.cn/
  4. // @version 0.1
  5. // @description Remove Lettcode Notes.
  6. // @author huzhenhua
  7. // @match https://leetcode-cn.com/problems/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. //'use strict';
  13.  
  14. var wait_duration = 1000;
  15. var try_times = 5;
  16.  
  17. setTimeout(function(){
  18. var note = document.querySelector('.note-btn-cn__uUt0')
  19. if(note != null) {
  20. note.remove();
  21. console.log("Note was removed.");
  22. } else if(--try_times >= 0) {
  23. setTimeout(arguments.callee, wait_duration);
  24. console.log("Try to remove note again.");
  25. } else {
  26. console.log("Note was failed to remove.");
  27. };
  28. }, wait_duration);
  29.  
  30. })();