0

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?

gal007
  • 6,911
  • 8
  • 47
  • 70
  • https://stackoverflow.com/questions/1905289/how-to-edit-a-javascript-alert-box-title – ajp15243 Sep 12 '14 at 19:01
  • 1
    You could use modals instead of alerts, like what bootstrap uses. – royhowie Sep 12 '14 at 19:01
  • 1
    don't use alert. Alert locks up the browser until it's acknowledged, preventing the page from running deferred tasks. You're basically blocking everyone else's work; especially on a mobile platform, that's really not a nice thing to do. – Mike 'Pomax' Kamermans Sep 12 '14 at 19:07

1 Answers1

1

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).

Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331