In laravel controlle" /> In laravel controlle" /> In laravel controlle"/>

Window.close() is not working after restart

542 Views Asked by At

<a href='.$login.' target ="_blank" onclick="window.close();"><i class="fa fa-sign-in f-s-25" style="margin-left: 10px;"></i></a>

In laravel controller I am using tag in which on button click window.close() is working well, but when i restart my server or my PC then after it is not working.

Please give me a solution for how to close the current tab in tag in the Laravel controller without using Javascript. Window.close() is not working in also firefox.

1

There are 1 best solutions below

6
Sehdev On

I tried your code and got the below error that means If your script did not initiate opening the window (with something like window.open), then the script in that window is not allowed to close it. Its a security to prevent a website taking control of your browser and closing windows.

"Scripts may close only the windows that were opened by it."