Changes between Initial Version and Version 1 of Ticket #35943


Ignore:
Timestamp:
Nov 26, 2024, 1:47:49 PM (106 minutes ago)
Author:
Natalia Bidart
Comment:

Thank you Adam for taking the time to create this ticket, and for linking adequate resources to do proper triage.

I'm accepting on the basis that this makes sense but I would like to see more research being done regarding what to use to replace unload. The linked MDN docs say:

The pagehide event is sent to a Window when the browser hides the current page in the process of presenting a different page from the session's history. For example, when the user clicks the browser's Back button, the current page receives a pagehide event before the previous page is shown.

Is not immediately clear to me that this is a good replacement. From these Chrome docs we may need to evaluate visbilitychange as well.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35943

    • Property Triage Stage UnreviewedAccepted
  • Ticket #35943 – Description

    initial v1  
    11Loading any ModelAdmin page in Chrome 117+ triggers this warning:
    2 
     2{{{
    33  Unload event listeners are deprecated and will be removed.
    44  1 source
    55  RelatedObjectLookups.js:203
    66  https://chromestatus.com/feature/5579556305502208
    7 
     7}}}
    88That’s here: https://github.com/django/django/blob/857b1048d53ebf5fc5581c110e85c212b81ca83a/django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js#L213-L215
    99
    10 The [https://github.com/fergald/docs/blob/master/explainers/permissions-policy-deprecate-unload.md 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.
     10The [https://github.com/fergald/docs/blob/master/explainers/permissions-policy-deprecate-unload.md linked proposal] points to [https://developer.mozilla.org/en-US/docs/Web/API/Window/pagehide_event pagehide] as a more reliable alternative, which seems like it would be compatible with the goal of closing child popups.
Back to Top