Bug 220623

Summary: onpagehide/onpageshow event listeners on WKWebView with bfcache intermittently not firing
Product: WebKit Reporter: chris.boakes
Component: Page LoadingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: achristensen, beidson, cdumez, smoley, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: iPhone / iPad   
OS: iOS 14   
Attachments:
Description Flags
Demonstration of the events not firing as expected none

Description chris.boakes 2021-01-14 06:15:43 PST
Created attachment 417613 [details]
Demonstration of the events not firing as expected

Have isolated the problem and can be seen here: https://lucid-shaw-b293da.netlify.app/

In WebView browser:

1. Navigate to Page 1
2. You should see the console.log “onpageshow - page 1, load”
3. Navigate to Page 2 
4. You should see the console.log “onpageshow - page 2, load”
5. Use the back button and you should see the console.log “onpageshow - page 1, load”
6. Go back and forth between Page 1 and 2 and the console logs intermittently do not fire

The expected behavior is that the onpageshow and onpagehide to fire every time but the events do not always fire when navigating backwards to a cached page
Comment 1 Radar WebKit Bug Importer 2021-01-21 06:16:15 PST
<rdar://problem/73450015>