Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

promptBox

The promptBox object represents the tab-modal prompts (or alerts) on a given tab. It's returned by the tabbrowser method getTabModalPromptBox method.

A tab may have multiple prompts on it; the tabmodalPromptShowing attribute on the tabbrowser will tell you how many prompts a given tab has.

Note: This is largely an implementation detail; if you're developing an add-on, you shouldn't need to tinker with this. You should use the window.alert() method or the nsIPrompt interface instead. See Using tab-modal prompts for details.

Method overview

nsIDOMElement appendPrompt(args, onCloseCallback);
void removePrompt(nsIDOMElement aPrompt);
NodeList listPrompts(nsIDOMElement aPrompt);

Methods

appendPrompt()

Creates a new prompt, adding it to the tab.

nsIDOMElement appendPrompt(
  args,
  onCloseCallback
); 
Parameters
args
Arguments for the prompt.
onCloseCallback
The callback routine to be called when the prompt is closed.
Return value

An nsIDOMElement object representing the new prompt.

removePrompt()

Removes an existing prompt.

void removePrompt(
  nsIDOMElement aPrompt
);
Parameters
aPrompt
The prompt to dispose of.

listPrompts()

Returns a list of all the prompts on the tabbrowser.

NodeList listPrompts(
  nsIDOMElement aPrompt
);
Parameters
aPrompt
This parameter isn't used; I don't know why it's even there.
Return value

A NodeList containing all of the prompt elements on the tabbrowser.

See also

Document Tags and Contributors

Tags: 
 Contributors to this page: Sheppy
 Last updated by: Sheppy,