Remove Leetcode's Premium Problems

If you are not a VIP member of leetcode, you can't solve the premium problems which have a lock after them. But we can get rid of them~~~~~~ Fuck them and give you a nice interface!

目前为 2017-06-23 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Remove Leetcode's Premium Problems
  3. // @namespace http://www.kongpingfan.com/
  4. // @version 0.1.1
  5. // @description If you are not a VIP member of leetcode, you can't solve the premium problems which have a lock after them. But we can get rid of them~~~~~~ Fuck them and give you a nice interface!
  6. // @author kongpingfan
  7. // @include *leetcode.com*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // Your code here...
  15. setInterval(getRidOf,1500);
  16. function getRidOf(){
  17. if (document.getElementsByClassName("fa-lock")){
  18. var elements=document.getElementsByClassName("fa-lock");
  19. for (var i =0;i<elements.length;i++){
  20. if (elements[i].parentNode.parentNode.tagName=="TR" ||elements[i].parentNode.parentNode.tagName=="tr" ){
  21. elements[i].parentNode.parentNode.style.display="none";
  22. }
  23. if (elements[i].parentNode.parentNode.parentNode.tagName=="TR" ||elements[i].parentNode.parentNode.parentNode.tagName=="tr" ){
  24. elements[i].parentNode.parentNode.parentNode.style.display="none";
  25. }
  26. }
  27. }
  28. }
  29. })();