Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Close firefox tab from javascript

I want to close Firefox tab from JavaScript. Please do not misunderstand me. I am not trying to close popup window but tab. I know JavaScript cannot close the window which it has not opened. Therefore I tried below code but it works in all browsers but not in Firefox.

window.open('','_self','');
Window.close();
like image 498
user2867978 Avatar asked Dec 09 '22 12:12

user2867978


1 Answers

If you have a single/few-user page and you have access to the Firefoxes you can change the about:config settings.

dom.allow_scripts_to_close_windows = true

This might be a big security issue!

(Tested with Firefox 27 on Linux)

like image 74
Nepomuk Frädrich Avatar answered Dec 11 '22 10:12

Nepomuk Frädrich