Because opening windows on mobile isn't necessarily appropriate, the Firefox Mobile team designed the
importDialog() method to replace
window.openDialog(). Instead of opening a new window, it merges the specified XUL dialog into the main window.
newDialog = importDialog(aParent, aSrc, aArguments)
- The opened window
- The dialog's parent; can be null.
- The chrome URL of the XUL dialog.
var dialog = importDialog(null, "chrome://myextension/content/dialog.xul", myObject);
The XUL passed to
importDialog() is very similar to XUL passed to
window.openDialog(), with some limitations and caveats:
<dialog>top level elements are permitted.
- Scripts are loaded via an attribute on the
<dialog>element, not via the
DOM Level 0. Not part of any standard.