I need to open a modal dialog after the Firefox extension is launched, and then close it after certain conditions.
I defined the dialog with an id = 'myWindowName' in the XUL file, and then launch it using window.openDialog('xul url', 'myWindowName', ...) directly without assigning it to any variable.
Then, I define y = document.getElementById('myWindowName') in a later function and use y.cancelDialog() to close it.
So far, it looks as though it's working, but I wanted to ask if this method is correct.
Does y=window.openDialog("url', 'myWindowName', ...) return the same reference as y=document.getElementByID('myWindowName') ?
Also, why doesn't window.cancelDialog() work? Is window.close() a better option to autoclose the dialog?