nsIDOMChromeWindow

This interface is implemented on the window object in chrome.
Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)

Method overview

void beginWindowMove(in nsIDOMEvent mouseDownEvent);
void getAttention();
void getAttentionWithCycleCount(in long aCycleCount);
void maximize();
void minimize();
void notifyDefaultButtonLoaded(in nsIDOMElement defaultButton);
void restore();
void setCursor(in DOMString cursor);

Attributes

Attribute Type Description
browserDOMWindow nsIBrowserDOMWindow The related nsIBrowserDOMWindow instance which provides access to yet another layer of utility functions by chrome script. It will be null for DOMWindows not corresponding to browsers.
messageManager nsIChromeFrameMessageManager Read only.
title DOMString Obsolete since Gecko 1.9.1
windowState unsigned short Returns current window state, the value is one of STATE_* constants. Read only.

Constants

Constant Value Description
STATE_MAXIMIZED 1 The window is maximized.
STATE_MINIMIZED 2 The window is minimized.
STATE_NORMAL 3 The window is normal.
STATE_FULLSCREEN 4 The window is in full screen mode.

Methods

beginWindowMove()

On some operating systems, we must allow the window manager to handle window dragging. This method tells the window manager to start dragging the window. This method will fail unless called while the left mouse button is held down, callers must check this.

void beginWindowMove(
  in nsIDOMEvent mouseDownEvent
);
Parameters
mouseDownEvent
Exceptions thrown
NS_ERROR_NOT_IMPLEMENTED
If the operating system does not support this method.

getAttention()

void getAttention();
Parameters

None.

getAttentionWithCycleCount()

Same as getAttention method excepting that this can specify the maximum number of times to animate the window per system conventions.

void getAttentionWithCycleCount(
  in long aCycleCount
);
Parameters
aCycleCount
The maximum number of times to animate the window per system conventions. If set to -1, cycles indefinitely until window is brought into the foreground. This behavior is same as getAttention method.

maximize()

Maximizes the window.

void maximize();
Parameters

None.

minimize()

Minimizes the window.

void minimize();
Parameters

None.

notifyDefaultButtonLoaded()

When a document has been loaded, the document can notify the default button of the document to the window by using this method.

When this method is called on Windows, Gecko moves the mouse cursor to center of the button if the auto cursor snap setting is enabled on the system. However, when the window isn't active at that time, the cursor isn't moved. On other systems, this method doesn't have any reaction currently.

This method is called automatically on dialog element or wizard element of XUL. If some XUL applications create a dialog like window which has a default button but it's not created by the dialog/wizard element, the applications should call this method for the accessibility and the usability on Windows at onload event.

void notifyDefaultButtonLoaded(
  in nsIDOMElement defaultButton
);
Parameters
defaultButton
The default button element of the window.

restore()

Restores the size and position of the window.

void restore();
Parameters

None.

setCursor()

Sets the mouse cursor to the specified cursor. The mouse cursor is locked to the specified cursor if it's not "auto". At that time, the cursor has been never changed by cursor moving. After you call this method with "auto", the cursor will be unlocked.

void setCursor(
  in DOMString cursor
);
Parameters
cursor
You can specify same values of CSS cursor property (including -moz- prefixed values). And there are special values: "grab", "grabbing" and "spinning". But they might be dropped in the future version, if you use the values, you should use -moz-* value instead.