Closed johnvang closed 2 months ago
Thanks for opening an issue. I see you asked if there is a way to avoid this without updating jQuery, but I would still suggest updating jQuery to 3.7.1, which limits the unload handler to IE and Edge Legacy. Upgrading from 3.6.3 to 3.7.1 should not have compatibility issues. setDocument
fires on load so there isn't really another way around it.
Description
Hi, I am on verstion 3.6.3. I have an application that opens an iFrame in a window that I am testing with the chrome flag for unload deprecation enabled (https://developer.chrome.com/docs/web-platform/deprecating-unload and chrome://flags/#deprecate-unload).
With the flag enabled, I am encountering permissions policy violation errors when opening and closing the iFrames, because the setDocument() method is attempting to attach the unload event to the iFrame.
`if ( preferredDoc != document && ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
Is there a way avoid this error without having to update jQuery? If I need to fire setDocument(), can I do it on my own in my iFrame unloading?
Link to test case