var PLUGIN_INFO = xml` {NAME} Tiny Menu for Vimperator 2.0pre 2.0 https://github.com/vimpr/vimperator-plugins/raw/master/tinymenu.js Yuichi Tateno MPL 1.1/GPL 2.0/LGPL 2.1 0.2 `; (function() { if (!liberator.plugins.tinymenu) { liberator.plugins.tinymenu = {}; } let tinymenu = liberator.plugins.tinymenu; if (tinymenu.popup) return; let menus = Array.slice(document.getElementById('main-menubar').childNodes); let popup = document.createElement('menupopup'); menus.reverse().forEach(function(elem) popup.appendChild(elem.cloneNode(true))); popup.setAttribute('id', 'vimperator-tinymenu-popup'); tinymenu.popup = popup; popup.addEventListener( 'popuphidden' , function(event) { popup.hidePopup(); } , false); commands.addUserCommand( ['opentinymenu'], 'Open the tiny menu ', function () { popup.openPopup(document.getElementById('status-bar'), 'before_end', 0, 0, false, true); }, true); document.getElementById('status-bar').appendChild(popup); })();