Reputation: 1
Please help me with closing a Chrome Tab using Javascript. I tried these - But all are failing.
open('about:blank', '_self').close(); - This opens up a new tab, and the user is able to browse back. Which is not required.
open(location, '_self').close(); - Scripts may close only the windows that were opened by it.
window.open('','_parent','');
window.close(); - Not working
Upvotes: 0
Views: 2082
Reputation: 167
As far as i know Chrome and Firefox have removed this feature of closing tab through JavaScript . Not sure about IE. Yet you can try this, it might work (Remember you can only close those tabs which you yourself have opened through script) Try
windows.top.close();
Hope this helps!
Upvotes: 1