Changes that exist only in this page, which leaving it would lose: consulted before the page or the app goes away.
Synchronous, so a beforeunload handler can decide.
beforeunload
Hands the changes on to where they are kept, resolving whether none is left.
Changes that exist only in this page, which leaving it would lose: consulted before the page or the app goes away.