Opened 9 hours ago

Last modified 6 hours ago

#35943 new Cleanup/optimization

Remove deprecated 'unload' event listener — at Initial Version

Reported by: Adam Johnson Owned by:
Component: contrib.admin Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Loading any ModelAdmin page in Chrome 117+ triggers this warning:

Unload event listeners are deprecated and will be removed.
1 source
RelatedObjectLookups.js:203
https://chromestatus.com/feature/5579556305502208

That’s here: https://github.com/django/django/blob/857b1048d53ebf5fc5581c110e85c212b81ca83a/django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js#L213-L215

The linked proposal points to [pagehide](https://developer.mozilla.org/en-US/docs/Web/API/Window/pagehide_event) as a more reliable alternative, which seems like it would be compatible with the goal of closing child popups.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top