WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

nsIDOMJSWindow

IID:c8188620-1dd1-11b2-bc88-df8440498add
Inherits From:nsISupports

Properties

readonly nsIDOMWindow frames

Window.frames in Netscape 4.x and IE is just a reference to the window itself (i.e. window.frames === window), but this doesn't make sense from a generic API point of view so that's why this is JS specific.

This property is "replaceable" in JavaScript.


Methods

void captureEvents ( PRInt32 eventFlags ) void clearInterval ( ) void clearTimeout ( ) void disableExternalCapture ( ) void dump ( DOMString str ) void enableExternalCapture ( ) PRBool find ( ) nsIDOMWindow open ( ) nsIDOMWindow openDialog ( ) DOMString prompt ( ) void releaseEvents ( PRInt32 eventFlags ) void routeEvent ( nsIDOMEvent evt ) PRInt32 setInterval ( ) void setResizable ( PRBool resizable ) PRInt32 setTimeout ( )

void captureEvents ( PRInt32 eventFlags )

Arguments:
eventFlags

void clearInterval ( )


void clearTimeout ( )

These methods take one optional argument that's the timer ID to clear. Often in existing code these methods are passed undefined, which is a nop so we need to support that as well.


void disableExternalCapture ( )


void dump ( DOMString str )

Arguments:
str

void enableExternalCapture ( )


PRBool find ( )


nsIDOMWindow open ( )

These are the scriptable versions of nsIDOMWindowInternal::open() and nsIDOMWindowInternal::openDialog() that take 3 optional arguments. Unlike the nsIDOMWindowInternal methods, these methods assume that they are called from JavaScript and hence will look on the JS context stack to determine the caller and hence correct security context for doing their search for an existing named window. Also, these methods will set the default charset on the newly opened window based on the current document charset in the caller.


nsIDOMWindow openDialog ( )


DOMString prompt ( )

The prompt method takes up to four arguments, the arguments are message, initial prompt value, title and a save password flag


void releaseEvents ( PRInt32 eventFlags )

Arguments:
eventFlags

void routeEvent ( nsIDOMEvent evt )

Arguments:
evt

PRInt32 setInterval ( )


void setResizable ( PRBool resizable )

This method is here for backwards compatibility with 4.x only, its implementation is a no-op

Arguments:
resizable

PRInt32 setTimeout ( )

These methods take typeless arguments and optional arguments, the first argument is either a function or a string, the second argument must be a number (ms) and the rest of the arguments (2 ... n) are passed to the callback function

Reference documentation is generated from Mozilla's source.