I'm trying to see the entire contents of a single value held in local storage in Safari (it's a long JSON object). When I view the key/value pair, the value is too long for the screen, and copying the row only copies the visible portion of the value. Is there a way to see the whole line?
In Safari, you can find Local Storage by first going to the Develop menu, then choosing Show Web Inspector, selecting the Storage tab and then selecting Local Storage from the side menu.
To get items from localStorage, use the getItem() method. getItem() allows you to access the data stored in the browser's localStorage object.
In short, you can't, but you can set a cookie via JavaScript 😉 Safari on iOS supports localStorage, but in Private Mode it simply throws an error when you try to save anything to it, which is not great. Also it breaks the behaviour of your app on iPhones and iPads.
You can access it using the console of the Safari Web Inspector. Just enter the command:
localStorage.getItem('yourKeyNameHere')
and it will output the full local storage value to the console.
For session storage, use
sessionStorage.getItem('yourKeyNameHere')
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