Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript Code to close tab that works in IE, Firefox and Chrome?

Tags:

javascript

Can anyone come with advice on how to close a tab in javascript that works for all browsers? Certain code snippets work only for certain browsers - anyone have a kind of a universal way that will cover the major browsers?

like image 503
oneiros Avatar asked Jan 29 '26 06:01

oneiros


1 Answers

In general, only browser windows created using JavaScript can be closed using JavaScript. Otherwise malware would be closing all of our browser windows on us.

like image 190
Diodeus - James MacFarlane Avatar answered Jan 30 '26 19:01

Diodeus - James MacFarlane