nuxt-history-state icon indicating copy to clipboard operation
nuxt-history-state copied to clipboard

PageSpeed Insights warning: unload event

Open arkhamvm opened this issue 1 year ago • 0 comments

Hello. PageSpeed Insights warning: image

https://web.dev/i18n/en/bfcache/#never-use-the-unload-event

window.addEventListener("unload", ( e => {
  this._save();
  try{
    sessionStorage.setItem("nuxt-history-state",tt().compressToUTF16(JSON.stringify([this._page,this._items])))
  }catch(e){
    console.error("Failed to save to sessionStorage.",e)}}))}}catch(e){console.error("Failed to access to sessionStorage.",e)
  }

arkhamvm avatar Jul 11 '23 12:07 arkhamvm