Skip to content

Instantly share code, notes, and snippets.

@yajd
Last active August 29, 2015 13:56
Show Gist options
  • Save yajd/9085804 to your computer and use it in GitHub Desktop.
Save yajd/9085804 to your computer and use it in GitHub Desktop.
inserting dynamic xul panel for roar panels
/*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.availWidth + 'px; height:' + screen.availHeight + 'px; background-color:transparent; -moz-pointer-events:none; border:0; -moz-appearance:none !important;'
}
for (var p in props) {
panel.setAttribute(p, props[p]);
}
var iframe = win.document.createElement('iframe');
iframe.setAttribute('style','border:0;margin:0;padding:0;width:100px;height:100px;box-shadow: 0 3px 3px rgba(0, 0, 0, 0.5); background: -moz-linear-gradient(270deg, #4E91E7, #184A95);border-radius:5px;');
//iframe.setAttribute('src','file:///C:/Users/ali57233/Documents/Unfollower/panels.htm');
//panel.appendChild(iframe);
win.document.querySelector('#mainPopupSet').appendChild(panel);
panel.openPopup(null, 'overlap', screen.availLeft, screen.availTop);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment