Closed Bug 1657277 Opened 4 years ago Closed 4 years ago

event onunload javascript not working correctly after version 79

Categories

(Core :: DOM: Core & HTML, defect, P5)

80 Branch
defect

Tracking

()

RESOLVED WORKSFORME

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.

Summary: event unload not working correctly after version 79 → event onunload not working correctly after version 79
Summary: event onunload not working correctly after version 79 → event onunload javascript not working correctly after version 79
Component: Untriaged → DOM: Events
Product: Firefox → Core

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.

Flags: needinfo?(juanludukeboss)

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.

Flags: needinfo?(juanludukeboss)

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/.

Component: DOM: Events → DOM: Core & HTML
Has Regression Range: --- → yes

I have added the attribute rel="opener" in my href link and now working correctly again.

Thank you very much. My problem is solved.

Severity: -- → S4
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Priority: -- → P5
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.