Rabbit hide bar

try to Hide bottom bar!

目前为 2019-02-12 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Rabbit hide bar
  3. // @version 0.3
  4. // @description try to Hide bottom bar!
  5. // @author You
  6. // @match https://www.rabb.it/s/*
  7. // @grant none
  8. // @namespace https://greasyfork.org/users/246423
  9. // ==/UserScript==
  10.  
  11. setTimeout(function(){ add(); }, 5000);
  12.  
  13. function add() {
  14. 'use strict';
  15. let buttonWrap = document.getElementsByClassName('controls')[0];
  16. var panels = document.getElementsByClassName('tray');
  17. var hidebtn = document.createElement("BUTTON");
  18. var showbtn = document.createElement("BUTTON");
  19. //var tray = document.getElementsByClassName('tray')[0];
  20. hidebtn.append(document.createTextNode("↓"));
  21. showbtn.append(document.createTextNode("↑"));
  22. buttonWrap.append(hidebtn);
  23. buttonWrap.append(showbtn);
  24. hidebtn.addEventListener ("click", toggleDown, false);
  25. showbtn.addEventListener ("click", toggleUp, false);
  26. function toggleDown(){
  27. for (let i = 0; i <panels.length; i++){
  28. panels[i].hidden=true;
  29. }
  30. }
  31. function toggleUp(){
  32. for (let i = 0; i <panels.length; i++){
  33. panels[i].hidden=false;
  34.  
  35. }
  36. }
  37. }