Why does onpageshow's persisted always turn on false? when it is opened by cell phone safari?

when the recent official account project opens the return button on ios, the page flashes and looks it up on the Internet because ios kernel browsers have BF cache, but use it

window.addEventListener("pageshow",function (e) {
    if (e.persisted) {
        window.location.reload()
    }
}

this method, e.persisted has always been false Why?

Dec.07,2021

I also encountered this problem, but if the react related package is introduced into the project, the code will work normally if the react related package is not used.

about Wechat's retreat and not refresh

Menu