script.js 905 B

1234567891011121314151617181920212223242526272829303132333435
  1. const remote = require('electron').remote
  2. //Opens DevTools window if you type "wcdev" in sequence.
  3. //This will crash the program if you are using multiple
  4. //DevTools, for example the chrome debugger in VS Code.
  5. const match = [87, 67, 68, 69, 86]
  6. let at = 0;
  7. document.addEventListener('keydown', function (e) {
  8. switch(e.keyCode){
  9. case match[0]:
  10. if(at === 0) ++at
  11. break
  12. case match[1]:
  13. if(at === 1) ++at
  14. break
  15. case match[2]:
  16. if(at === 2) ++at
  17. break
  18. case match[3]:
  19. if(at === 3) ++at
  20. case match[4]:
  21. if(at === 4) ++at
  22. break
  23. default:
  24. at = 0
  25. }
  26. if(at === 5) {
  27. var window = remote.getCurrentWindow()
  28. window.toggleDevTools()
  29. at = 0
  30. }
  31. })
  32. console.log('Can you see me? ( ͡° ͜ʖ ͡°) Then it\'s working!')