event onunload javascript not working correctly after version 79
Categories
(Core :: DOM: Core & HTML, defect, P5)
Tracking
()
People
(Reporter: juanludukeboss, Unassigned)
References
(Regression, )
Details
(Keywords: regression)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:80.0) Gecko/20100101 Firefox/80.0
Steps to reproduce:
window.onbeforeunload = function(){
return 'Los cambios no guardados se perderan, ¿Desea salir?';
}
window.onunload = function(){
window.opener.document.getElementById('alert-content').innerHTML='';
window.opener.document.getElementById('bttsearchdoc').click();
}
Actual results:
since version 79 of firefox the javascript "onunload" event does not work. No execute the action inside event "onunload". I have verified that it works well in firefox version 78 and olders, but in the version 79 and 80 it does not work. This is a serious problem for some web apps. Now, I have started to use Chrome due to this issue and I have always liked firefox more.
Expected results:
This should do the actions inside the "onunload" event. Well, in all versions of firefox before 79 it has always worked well.
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Updated•4 years ago
|
Updated•4 years ago
|
Comment 1•4 years ago
|
||
Thanks for reporting this issue! Could you share a test page and steps so we can try to reproduce this issue on our end? Thanks.
Updated•4 years ago
|
Reporter | ||
Comment 2•4 years ago
|
||
Yes, I make a test page with the problem:
https://application.onnix.es:880/onnix/application/views/es/test_page_1
This page, show a link, that when you click open other page 2 in other tab. So when you close Page 2, the text "Link Clicked" of page 1 shoud be cleaned, but is not working with firefox. I have tested the same in Chrome and it working correctly.
Thanks, I hope you can solve it quickly, because it is very important for me and for many web pages.
Updated•4 years ago
|
Comment 3•4 years ago
|
||
This is not related unload
event, but the opener setup for anchors with target=_blank.
See https://www.fxsitecompat.dev/en-CA/docs/2020/target-blank-on-anchors-now-implies-rel-noopener/.
Updated•4 years ago
|
Reporter | ||
Comment 4•4 years ago
|
||
I have added the attribute rel="opener" in my href link and now working correctly again.
Thank you very much. My problem is solved.
Updated•4 years ago
|
Updated•4 years ago
|
Description
•