When I write a comment with github's issue page, I noticed that the comment body remains even if I reload the browser.
I have checked localStorage, sessionStorage, cacheStorage, IndexedDB, cookie, but I found no instance of the sentence that I wrote.
Also, I have checked the network tab of Chrome Devtool, but I could not find any suspicious network traffic.
How does github.com achieve this recovery function?
They are using SessionStorage
to do this:
On Page Leave:
.js-session-resumable
as selectorSessionStorage
as session-resume:/current/page/path
On Page Load:
session-resume:/current/page/path
key in SessionStorage
SessionStorage
Note: If you write a comment in a page (without submitting it) and go to another page, then you can see your comment saved in SessionStorage
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With