Is it possible to retrieve data from chrome/firefox local storage using C#?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Disclaimer: I have tested this on my Windows 7 x64 running Google Chrome 13.0.782.220 at the moment. The information provided here is a result of my own research and is not any official way or API to retrieve this information. Use at your own risk. Also the technique presented here might break with any future release if Chrome changes the way to store this information.
So, Google Chrome uses SQLite to persist local storage data. You could use the System.Data.SQLite managed driver to read it from your .NET application. If you are running on Windows 7 (don’t know for others as that’s the one I have and can test), you will have the following folder:
This folder will contain multiple files with the
.localstorageextension. Each file is for different site. For example for StackOverflow I havehttp_stackoverflow.com_0.localstoragebut of course this naming is totally arbitrary and you cannot rely upon it. Each file represents a SQLite database.I have noticed that this database contains a table called
ItemTablewith 2 string columns calledkeyandvalue.So to read the values it’s a simple matter of sending a SQL query: