I working on installable package web app.

In my main.html, have a function look like this

if( user clicks) { localStorage["doc"] = 5;}

Testing out, I click the button, a new row appear immediately in local storage, which is cool. But If I refresh the app, the row disappears.

What seem to be the problem?