I have a requirement where I need to auto close the browser page. I tried all JavaScript methods i.e. window.close(), (_self).close but none of the option work for me. Appreciate if there is any suggestion.
Hi,Based on my experience, you can only close a browser window with window.close() if it was opened by your script using window.open().
Closing a window that wasn’t opened by your script is generally restricted for security reasons.
There might be more experienced developers who have alternative solutions or workarounds.Kind regardsThibaut
Hi @ABU Application Support
You can use window.top.close(); JavaScript method instead of window.close();, This should close the current tab.
i hope it'll help you.
ThanksDeep
I agree with @Thibaut G there is no other method to close window which are not open programmatically .
because of This restriction exists to prevent malicious websites from interfering with the user's browsing experience. Browsers prioritize user control over their browsing environment, so such actions are intentionally limited.
if you want to close then open window programmatically .
I attached a Sample OML which open and close via programmatically .
Regards ,
Rajat