Window.importDialog()

Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

Obsolete
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

This function was only available in the original, XUL-based version of Firefox for Android, which is no longer supported; for that reason, this function is obsolete and should never be used.

Summary

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.

Syntax

newDialog = importDialog(aParent, aSrc, aArguments)
newDialog
The opened window
aParent
The dialog's parent; can be null.
aSrc
The chrome URL of the XUL dialog.
aArguments
A JavaScript object containing data to pass to the dialog.

Example

var dialog = importDialog(null, "chrome://myextension/content/dialog.xul", myObject);

Notes

The XUL passed to importDialog() is very similar to XUL passed to window.openDialog(), with some limitations and caveats:

  • Only <dialog> top level elements are permitted.
  • Scripts are loaded via an attribute on the <dialog> element, not via the <script> tag.

The XUL is merged into the existing window, almost like a XUL overlay. Because of this, element ID and JavaScript conflicts are possible, just like overlays. So be careful.

Specification

This is not part of any specification.