[buddypress-trac] [BuddyPress Trac] #9299: Unload event handler in buddypress-notifications.js breaks bfcache
buddypress-trac
noreply at wordpress.org
Mon Aug 11 23:08:56 UTC 2025
#9299: Unload event handler in buddypress-notifications.js breaks bfcache
--------------------------+-----------------------------
Reporter: westonruter | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Core | Version: 3.0.0
Severity: normal | Keywords:
--------------------------+-----------------------------
The use of the `unload` event handler
[https://github.com/buddypress/buddypress/blob/8c0406454b260566fb17fc6cb21d755838eac675/src
/bp-templates/bp-nouveau/js/buddypress-notifications.js#L57-L58 in
buddypress-notifications.js] is currently making the Notifications page
[https://web.dev/articles/bfcache#never-use-the-unload-event ineligible
for bfcache]. This event is unreliable, and it will be
[https://developer.chrome.com/docs/web-platform/deprecating-unload
deprecated and removed from Chrome]. A more appropriate event should be
used, such as `pagehide`. This was done in core with
[https://core.trac.wordpress.org/ticket/55491 #55491].
The addition of `unload` goes far back to commit
[https://github.com/buddypress/next-template-
packs/commit/193538d658fa8c63af769f324631fc2ad4e557c9 193538d] on July 12,
2016 in buddypress/next-template-packs and
[https://github.com/buddypress/buddypress/commit/694aee3a61b3afa8b4442a2e2d60aaa8d7fd2194
merged] for 3.0.0-RC1.
Enabling bfcache in WordPress while being logged-in is enabled via the
[https://wordpress.org/plugins/nocache-bfcache/ No-cache BFCache] which is
a feature plugin to implement
[https://core.trac.wordpress.org/ticket/63636 #63636].
Aside: I blogged about bfcache in WordPress in this post:
[https://weston.ruter.net/2025/07/23/instant-back-forward-navigations-in-
wordpress/ Instant Back/Forward Navigations in WordPress].
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/9299>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list