A solution could only be realised using JavaScript. However, the button would only work under certain conditions.
The background in detail
Prevent misuse
In the past, window.close() was often misused - for example by pop-ups, malware pages or phishing websites - to prevent users from leaving websites or to keep control of their browser window. For this reason, the behaviour has been restricted.
Keep control in the hands of the user
The browser should leave the user in control. A script should not be able to close windows that the user has opened manually without consent.
Conclusion
Only windows that have been opened by a script may also be closed by a script. This ensures that JavaScript does not take control of the tabs opened by the user. This restriction therefore represents a protective mechanism against misuse.
As the form can be opened in various ways, but mainly by users, implementation will not be successful.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article