I was about to ask 'How to "download" localStorage?' but fortunately found this and my original question was solved.
Now then, how can I allow the user to "upload" a local file to localStorage or javascript in general? I'm not asking the way to access the local files in background which is clearly prohibited; I want the user to select their local file explicitly.
For example, if the user has save.json:
{
"hp": 32,
"maxHp": 50,
"mp": 11,
"maxMp": 23
}
How can I set this to localStorage by just asking the user to upload this file?