Use Devtools to see what the browser is storing #
This is one of several articles for people wishing to try out different aspects of the devtools in Firefox.
When you use web pages and web applications what is stored in the Firefox or Chrome browser? Read some of the descriptions here:
Browse things stored in the client #
Many objects (objects in a JS sense) are stored in the browser when you use a web page. These are not hidden or mysterious. They are easy to browse in the devtools. In Firefox:
Will reveal several types of stored things:
- Indexed DB
- Local storage
- Session storage
Local Storage vs Cookies #
Local Storage Methods #
- localStorage.setItem(key, value)
Cookie Exercise to try #
Here is homework .
- Go to your browser's cookies list:
- (optional) If you don't have many cookies, get some. Go to commercial sites: Amazon, OfficeSupply.com. Go to some high content story sites: vox.com, scoutingmagazine.org/ your local newspaper, yahoo.com. Do some browsing to accumulate some cookies
- Look at pairs of sites. For their cookies, describe what is the same and what is different (do this in any way that makes sense for you, think of your audience, get your ideas across any way you prefer). Choose sites with 2 or more cookies.
a. two sites that sell things
b. a high traffic site and a less high traffic site
c. two sites with URLs ending in .edu domain (If stumped you can find these by putting "site:.edu into Duck Duck Go or Google")
d. two sites with a URL ending in the .gov domain
Local Storage exercise to try #
- Store a property. Get the browser console
(Firefox: Ctl+Shift+I) -> Console
Store your own silly property
localStorage.setItem('froggy', 42); undefined
Is the item still there? Check!
Remove your made up proper property using any method listed above in the Methods section.
Confirm it is gone, using something similar to
Combined Exercise to try #
- Use everything from above to look at some interesting large websites and see which properties that are typically stored in cookies versus which properties are typically stored in local storage. This is open-ended; there is no right answer.