Assume you create a new window (pop-up) using javascript and have its content be something like this:
<html>
<body>
<form action="some_action.php" targe… (read more)
Assume you create a new window (pop-up) using javascript and have its content be something like this:
<html>
<body>
<form action="some_action.php" target="_blank">
... some form fields ...
<button onclick="window.close()">
submit in new tab & close pop-up
</button>
</form>
<a href="some_page.php" target="_blank" onclick="window.close()">
open link in new tab & close pop-up
</a>
</body>
</html>
If you click the button "submit in new tab & close pop-up" the following should happen:
- Firefox submits the form in a new tab (because target="_blank" is set in the <form>)
- The pop-up closes itself (because onclick="window.close()" is set)
And if you click the link "open link in new tab & close pop-up" the following should happen:
- Firefox opens the link in a new tab (because target="_blank" is set in the <a>)
- The pop-up closes itself (because onclick="window.close()" is set)
However, what happens instead is this:
- Firefox only opens an empty tab, i.e. the submission of the form / the opening of the link fails
- The pop-up closes itself
This clearly seems to be a bug, right? Is this a known problem?
I tested it with older versions and the problem apparently was introduced relatively recently with Firefox 72. More precisely, the form submission bug was introduced with Firefox 72 Beta 1 and the link opening bug was introduced with Firefox 72 Beta 7.
In Chrome and Internet Explorer both cases work as expected.