Search code examples
javascriptfirefox-addonfennec

"JavaScript application" Alert message


I'm creating an extension for Firefox for Android which adds dinamically some elements to DOM, and some of them needs to display an alert message.

var li=window.content.document.createElement('li');
li.onclick = function(){
   alert("lalalalalalallalallalala");
}

So I got it, but when the message is displayed, the alert has a "[JavaScript Application]" title. Is there a way to change that title?


Solution

  • You cannot do this using the alert method. Its for the security reasons.

    As an alternative you can use showModalDialog for that purpose instead.

    Dialog boxes are modal windows - they prevent the user from accessing the rest of the program's interface until the dialog box is closed. For this reason, you should not overuse any function that creates a dialog box (or modal window).