Reputation: 465
In firefox addon, I'm trying to create a popup like this for use in my addon - is it possible? If so, how's it done?
Thanks in advance.
Upvotes: 1
Views: 68
Reputation: 37298
var sDOMWin = Services.wm.getMostRecentWindow(null);
var sa = Cc["@mozilla.org/supports-array;1"].createInstance(Ci.nsISupportsArray);
var wuri = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString);
wuri.data = 'http://www.bing.com/';
sa.AppendElement(wuri);
let features = "chrome,width=300,height=400";
if (PrivateBrowsingUtils.permanentPrivateBrowsing || PrivateBrowsingUtils.isWindowPrivate(sDOMWin)) {
features += ",private";
} else {
features += ",non-private";
}
var XULWindow = Services.ww.openWindow(sDOMWin, 'chrome://browser/content/browser.xul', null, features, sa);
taken from here: https://stackoverflow.com/a/28523802/1828637
and here's a complete list of features: https://developer.mozilla.org/en-US/docs/Web/API/Window/open#Position_and_size_features like you probably want scrollbars and minimizable and possibly resizable
Upvotes: 1