Rabbit hide bar

try to Hide bottom bar!

目前為 2019-02-12 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Rabbit hide bar
// @version      0.1
// @description  try to Hide bottom bar!
// @author       You
// @match        https://www.rabb.it/s/*


// @namespace https://greasyfork.org/users/246423
// ==/UserScript==

(function() {
    'use strict';
     buttonWrap = document.getElementsByClassName('leftToggle')[0];
     hidebtn = document.createElement("BUTTON");
     tray = document.getElementsByClassName('tray')[1];
     hidebtn.append(document.createTextNode("↓"));
     buttonWrap.appendChild(hidebtn);
     p = tray.parentNode;
     buttonWrap.addEventListener ("click", toggle, false);

    function toggle(){
        if(tray.parentNode === null) {
            p.appendChild(tray)
        } else
        {
            p.removeChild(tray)
        }
    }
})();