Modify the title of the dialog box such as Alert/confirm in the Firefox plugin

Source: Internet
Author: User

Https://developer.mozilla.org/en/nsIPromptService

If you use a dialog box such as Window.alert or Window.confirm, its title has no way to change.

In order to be able to modify the title of this dialog box in Firefox plugin, you can replace it with the following code:

function Triggeralert (title, message) {
	var nsips = components.classes["@mozilla. Org/embedcomp/prompt-service;1" ].getservice (Components.interfaces.nsIPromptService);
	Nsips.alert (null, title, message); 
}

function triggerconfirm (title, message) {
	var nsips = components.classes["@mozilla. Org/embedcomp/prompt-service; 1 "].getservice (Components.interfaces.nsIPromptService);
	return Nsips.confirmcheck (NULL, title, message, "", {value:false});
}

For more information, please refer to:

Https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIPromptService

http://www.ibm.com/developerworks/cn/web/1108_chengfu_ffplugin/

Https://developer.mozilla.org/en/Code_snippets/Dialogs_and_Prompts#Passing_arguments_and_displaying_a_ Dialog

Https://developer.mozilla.org/En/XUL

https://www.ibm.com/developerworks/cn/web/ wa-lo-firefox-ext/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.