Opened 3 months ago

Last modified 8 weeks ago

#35943 assigned 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: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
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.

According to the ticket's flags, the next step(s) to move this issue forward are:

  • To improve the patch as described in the pull request review comments or on this ticket, then uncheck "Patch needs improvement".
  • If creating a new pull request, include a link to the pull request in the ticket comment when making that update. The usual format is: [https://github.com/django/django/pull/#### PR].

Change History (0)

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