Show garbage in invisible

shows normal and solid garbage in invisible mode

  1. // ==UserScript==
  2. // @name Show garbage in invisible
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description shows normal and solid garbage in invisible mode
  6. // @author Oki
  7. // @match https://*.jstris.jezevec10.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. /**************************
  12. Show garbage in invisible
  13. **************************/
  14.  
  15. (function() {
  16. window.addEventListener('load', function(){
  17.  
  18. if(typeof trim != "function"){var trim=a=>{a=a.slice(0,-1);a=a.substr(a.indexOf("{")+1);return a}}
  19.  
  20. var types = [Ctx2DView['prototype']['redrawMatrix'].toString(), WebGLView['prototype']['redrawMatrix'].toString()]
  21. drawnMino = types[0].substr(types[0].lastIndexOf("this"),types[0].substr(types[0].lastIndexOf("this")).indexOf(")"))
  22. isInvisible = types[0].split("if(")[1].substr(0,types[0].split("if(")[1].indexOf(")"))
  23. invisCondition = "if (!("+isInvisible+" && "+drawnMino+" < 8)) {"
  24.  
  25. for (var i = 0; i < types.length; i++) {
  26. types[i] = types[i].replace("return", "")
  27. types[i] = types[i].replace("++){this", "++){" + invisCondition + "this")
  28. types[i] += "}"
  29. }
  30.  
  31. Ctx2DView['prototype']['redrawMatrix'] = new Function(trim(types[0]));
  32. WebGLView['prototype']['redrawMatrix'] = new Function(trim(types[1]));
  33.  
  34. });
  35. })();