I want to close a currently opened tab when I click on a button using Angular 6. I have tried using window.close() function but it is returning a warning "Scripts may close only the windows that were opened by them.", How can I achieve this functionality?
Asked
Active
Viewed 22 times
0
-
The message you are receiving is correct. – mwilson Aug 28 '20 at 16:35
-
Is there any other way to achieve this? – Rama Prakash Aug 31 '20 at 04:56
-
Open the window through JavaScript and then you can close it. I don't know what you're use case is, but maybe a dialog or some other form of popup would fit better. – mwilson Aug 31 '20 at 16:30