Created
March 9, 2014 10:51
-
-
Save Noitidart/9445992 to your computer and use it in GitHub Desktop.
_ff-addon-snippet-InsertXULPanel - How to create and insert a panel that fills the whole screen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*run this first*/ | |
| var win = Services.wm.getMostRecentWindow('navigator:browser'); | |
| var panel = win.document.createElement('panel'); | |
| var screen = Services.appShell.hiddenDOMWindow.screen; | |
| var props = { | |
| noautohide: true, | |
| noautofocus: false, | |
| level: 'top', | |
| style: 'padding:15px; margin:0; width:' + screen.width + 'px; height:' + screen.height + 'px; background-color:steelblue;' | |
| } | |
| for (var p in props) { | |
| panel.setAttribute(p, props[p]); | |
| } | |
| win.document.querySelector('#mainPopupSet').appendChild(panel); | |
| panel.addEventListener('dblclick', function () { | |
| panel.parentNode.removeChild(panel) | |
| }, false); | |
| panel.openPopup(null, 'overlap', screen.availLeft, screen.availTop); |
Author
Author
Trying to make it overlap whole monitor, while working on NativeShot, its not covering everything on Ubuntu.
var win = Services.wm.getMostRecentWindow('navigator:browser');
var panel = win.document.createElement('panel');
var screen = Services.appShell.hiddenDOMWindow.screen;
var props = {
noautohide: true,
noautofocus: false,
level: 'top',
style: 'border:0; -moz-appearance:none; padding:0; margin:0; width:' + screen.width + 'px; height:' + screen.height + 'px; background-color:steelblue;'
}
for (var p in props) {
panel.setAttribute(p, props[p]);
}
win.document.querySelector('#mainPopupSet').appendChild(panel);
panel.addEventListener('click', function () {
panel.parentNode.removeChild(panel)
}, false);
panel.openPopup(null, 'beforestart', screen.left, screen.top);
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
README
Rev1
Initial
Rev2