Skip to content

Instantly share code, notes, and snippets.

@Noitidart
Created March 9, 2014 10:51
Show Gist options
  • Select an option

  • Save Noitidart/9445992 to your computer and use it in GitHub Desktop.

Select an option

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.
/*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);
@Noitidart
Copy link
Copy Markdown
Author

README

Rev1

Initial

Rev2

@Noitidart
Copy link
Copy Markdown
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