Rabbit hide bar

try to Hide bottom bar!

当前为 2019-02-12 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Rabbit hide bar
  3. // @version 0.1
  4. // @description try to Hide bottom bar!
  5. // @author You
  6. // @match https://www.rabb.it/s/*
  7.  
  8.  
  9. // @namespace https://greasyfork.org/users/246423
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. buttonWrap = document.getElementsByClassName('leftToggle')[0];
  15. hidebtn = document.createElement("BUTTON");
  16. tray = document.getElementsByClassName('tray')[1];
  17. hidebtn.append(document.createTextNode("↓"));
  18. buttonWrap.appendChild(hidebtn);
  19. p = tray.parentNode;
  20. buttonWrap.addEventListener ("click", toggle, false);
  21.  
  22. function toggle(){
  23. if(tray.parentNode === null) {
  24. p.appendChild(tray)
  25. } else
  26. {
  27. p.removeChild(tray)
  28. }
  29. }
  30. })();