beforeunload in iFrame not being fired when the parent page is redirected

2,516 views
Skip to first unread message

Jacques Ramsden

unread,
Jul 2, 2018, 12:41:07 PM7/2/18
to Chromium-dev
In Chrome 67 it seems that having a parent page with an iFrame no longer fires the beforeunload event when the parent page is redirected.

I have tried the following with no luck

attachEventListener to in the iFrame to the beforeunload

Directly set the window.onbeforeunload event to a function 

Close the parent page, remove the iframe from the dom, set the iFrame src to about:blank/ '', _blank etc in none of the scenarios does the attached event function get called?

This worked in 66 how do I get this to work in 67?

Please could someone assist with this its quite urgent. 

Alex Moshchuk

unread,
Jul 2, 2018, 5:09:57 PM7/2/18
to ramsden...@gmail.com, Chromium-dev, Charlie Reis
Is your iframe cross-origin from the parent page?  There is a known problem with out-of-process iframes and beforeunload handlers in M67 that we're working on fixing right now: https://crbug.com/853021.  Can you see if this bug matches what you're seeing and if so, comment there with a repro URL and any other details about your use case?  We can discuss potential workarounds on the bug as well.

Thanks,
Alex

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/759534a1-89a2-40ea-abc0-1060d5f74729%40chromium.org.

Jacques Ramsden

unread,
Jul 3, 2018, 3:21:31 AM7/3/18
to Chromium-dev, ramsden...@gmail.com, cr...@chromium.org
Hi Alex,

Thanks for your feedback. I have had a look at the link you provided and it appears to be the same issue.

All comments seem to cover my scenario so no need to add another (Don't want to bloat the discussion with duplicate information)

I see that this has been pushed to M68, is there any ETA on the release for M68?

Thanks again!

Regards
Jacques

Alex Moshchuk

unread,
Jul 3, 2018, 2:39:51 PM7/3/18
to Jacques Ramsden, Chromium-dev, Charlie Reis
Thanks for confirming!  M68 stable is scheduled to go out in about three weeks, though the fix might be available sooner in M68 beta.  I've CC'ed you on the bug so you can follow along.

Reply all
Reply to author
Forward
0 new messages