After a bit of preliminary searching, it seems like it's impossible to do what you want. This is mainly due to security reasons, I think.
It is not recommended to use an alert box because (WebPlatform):
- This is a synchronized method call. Meaning, calling this method pauses scripting execution of the window from which this method is
called, until the user closes the displayed dialog. Also, depending on
your cross tab/window usage, this can sometimes pause scripting
executions of other windows/tabs from the same domain.
- Calling this method in some browsers prevents the user from interacting with the entire browser, or browser window (along with all
of its tabs), until the dialog is closed.
- Intrusive dialog boxes are generally annoying for the user.
You could create your own dialog box using one of these:
You could always have an alert that says: "Hey, look here, user, I'm trying to tell you something!" and then use one of the above.
Another alternative would be to create a popup using JavaScript
window.open("http://example.com");
or
You could use showModelDialog or showModelessDialog
where you can use dialogArguments, dialogHeight, dialogWidth, dialogLeft, and dialogTop.
But the problem with that is that most people have popup blockers which would block your innocent popups.
An ActiveX only possibility seems to be the Modified Alert Box. I have not tested this as I do not have a Windows computer.
There also is nsIPromptService's alert and/or alertCheck. These seem to offer more functionality such as adding a title, or a check box. There are also prompts, selections, etc.
Unfortunately, this doesn't seem to be available in Javascript. It seems like it's only available for firefox extensions, etc (chrome users).