0
How to store data in localStorage?
There's a problem to store data in the localStorage directly via mobile App. It's only enabled from the browser. When I try to do this on the mobile app I get an error: "Uncaught SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document" https://code.sololearn.com/WBykIlB40AXS/?ref=app
6 odpowiedzi
+ 2
Sorry about the delayed response. To answer you last question.
The code snippet I copied from 3WSchools purpose is to check if the browser supports webstorage. But in the this case webview does support webstorage but instead ,as I have said in previous replies, webstorage is disabled.
Since it is disabled, my code as is produces uncaught error when ran on using sololearn app on an android device. To solve this I should I used try/catch to take care of the uncaught error.
https://code.sololearn.com/WuKC09Uv93bJ/#
+ 1
Unfortunately it not a problem but a choice. Sololearn chose not to enable the use of localStorage via the android app. But for some reason on the iOS app, local storage is available.
https://code.sololearn.com/WBEDb4ikkZvP/#
+ 1
Bless your ❤
There is nothing to report. Sololearn uses webview to present their web page on an android device. And because of this they have the ability to enable or disable local storage. They chose to disable sable local storage.
https://www.techtarget.com/searchsecurity/definition/Android-Webview
0
I know it does't work and I also reported that but I asked how to fix it or if there's some workaround?
0
But I open your code on Android and instead of going into else scope and displaying message "Sorry, your browser does not support web storage..." I get the console log error "Uncaught SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document"😕 can you explain why?
0
No problem, it works now, so thanks a lot🙏