close current browser tab

I used the script

<script type = "text/javascript">

function closeWindow(){
window.open('','_self','');
window.close();
}

</script>

this works well with IE (it overrides prompt) and chrome but is not
working with Firefox as by default Firefox don't allow to close tab
using JavaScript
It is needed to follow these steps in Firefox
1. Go to address bar and type about:config
2. Go to parameter dom.allow_scripts_to_close_windows
3. Set its value as true

Comments

Popular posts from this blog

Rails Memcache issues

Enabling password authentication for new ec2 box | ssh, ssh config, EC2 setup, new user in EC2, PasswordAuthentication

Ruby on Rails 3.x Skip callback and validation and reset Callback | Ruby on Rails, Skip callback, validation, reset Callback