문제

Is there an event that listens if app is closed? I want to clear my localStorage when it closes. So something like

document.addEventListener("applicationClose", yourCallbackFunction, false);

Any suggestion would be helpful!

Or to erase it when app starts!

도움이 되었습니까?

해결책

I ended up using sessionStorage, it is equal to the localStorage object, except that stores data for only one session

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top