Closing browser window or tab in Mozilla/Firefox

Hi All,

Sometime we face the problem in closing a window/tab in Mozilla Firefox. The reason is that Firefox configuration doesn’t allows users to close active tabs or windows which are not opened by the script. The script means here refers to the pop up windows, opened using “window.open()” method.

Below I will share a very tricky steps to do that.

Steps:
–          Open Mozilla
–          Type “about:config” in address bar
–          You will see a list of some configurations
–          Search for “dom.allow_scripts_to_close_windows” and toggle to “true”, by default value will be “false”

Now create one HTML page, and add the below java script method to close the window.

<script>

function closeWin(){
window.close();
}

</script>


Thanks
R Vashi

4 thoughts on “Closing browser window or tab in Mozilla/Firefox

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s