Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to view the contents of localStorage on the iPad?

In Settings/Safari, there is a Databases entry that allows me to view databases that have been created on my iPad (not their contents, but their size and origin).

However, I don't see any way to see what's in localStorage. I'm using the console to access localStorage in Safari (Develop > Show Web Inspector and clicking on the Storage tab).

Is there a way to view localStorage on the iPad that I'm missing?

Thanks

like image 586
Elisabeth Avatar asked May 03 '11 17:05

Elisabeth


People also ask

Where is local storage on iPad?

Local storage is the space available directly on a device, like your iPad. You don't need an internet connection to access files saved locally, but you must have your device with you if you want to access the files. The Files app on your iPad is an example of local storage.

How do I access localStorage in Safari?

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.

How do I access local storage data?

To get items from localStorage, use the getItem() method. getItem() allows you to access the data stored in the browser's localStorage object.

Where is local storage on iOS?

Go to Settings > General > [Device] Storage. You may see a list of recommendations for optimising your device's storage, followed by a list of installed apps and the amount of storage each one uses. Tap an app's name for more information about its storage.


2 Answers

If you have access to an Apple computer, you can use Safari's Web Inspector to inspect stuff on your iPad - including localStorage and sessionStorage.

  • In your iPad, go to Settings > Safari > Advanced and turn on Allow Remote Debugging.

  • Then, plug it into your Apple computer.

  • In Safari, go to your settings and choose Advanced. Check the box that says Show Develop menu in the menu bar.

  • Now, if you click on develop on the top menu bar, you will be able to see your iPad. You will be able to inspect elements and use it much like Webkit's Web Inspector.

Currently, though, it is not using the standard Webkit inspector - and many people have an issue with this.

like image 70
Martin Avatar answered Sep 23 '22 03:09

Martin


You can access localStorage with javascript commands. (See https://developer.mozilla.org/en/dom/storage#localStorage for reference.)

To debug remotely, try using http://jsconsole.com/.

Also, you can enable viewing of console.log() output under iPad Settings -> Safari, which might help you debug locally.

like image 36
Teddy Avatar answered Sep 22 '22 03:09

Teddy