Created: 2012-03-24 21:40
Updated: 2014-04-25 19:22

Firefox Popup Alerts

Simpe library that adds two new methods to the window:

window.falert(); window.fconfrim();

Add focus back to alerts and confirms in a popup windows only for FF 4+

  • Author: Steven Irby
  • License: GPLv2/MIT

Installation and Usage

Just add JS file to the page of a popup you want to focus with an alert or confirm. (only way to focus a popup window in FF 4+ now; without having the user initiate a function) If user clicks ok for an alert, the page is reloaded.

1. Add Script to popup window

<script type="text/javascript" src="focusalerts.js"></script>

2. falert:

falert( message [, url ] );

url - default is window.location.href + '?'


window.falert('Alert with focus!');
window.falert('Alert with focus!', '');

2. fconfirm

fconfirm( message [, url] [, cancelCallback ] [, okCallback ]);


function close() {

window.fconfirm('Do you want to continue?', null, close);
Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more