Learn · Operating systems

Browsers

A browser profile is a folder of SQLite databases and JSON files. It records where the user went, how they got there, what they downloaded and which tabs were open, on every operating system alike.

1 Profiles and their files

Chrome (and Edge, Brave, Opera: Chromium)Firefox
Windows%LOCALAPPDATA%\Google\Chrome\User Data\Default\%APPDATA%\Mozilla\Firefox\Profiles\<id>.default-release\
macOS~/Library/Application Support/Google/Chrome/Default/~/Library/Application Support/Firefox/Profiles/<id>/
Linux~/.config/google-chrome/Default/~/.mozilla/firefox/<id>/ (Snap: ~/snap/firefox/common/.mozilla/)
HistoryHistory: urls, visits, downloads, keyword_search_termsplaces.sqlite: moz_places, moz_historyvisits, bookmarks, download annotations
CookiesNetwork/Cookies (values encrypted)cookies.sqlite (plain text)
Passwords, formsLogin Data, Web Data (encrypted)logins.json + key4.db, formhistory.sqlite
Open tabsSessions/ (Session_…, Tabs_…)sessionstore-backups/recovery.jsonlz4
CacheCache/Cache_Data/ (in the local, non-roaming profile)cache2/entries/ (Windows: under %LOCALAPPDATA%)
Time formatWebKit: µs since 1601-01-01 UTCPRTime: µs since 1970-01-01 UTC

Close the browser, or copy the databases together with their -journal/-wal files (Firefox keeps places.sqlite in WAL mode, see the WAL page). Several profiles are common (Profile 1, Profile 2, several Firefox profile folders): check Local State and profiles.ini.

2 Chrome: urls and visits

Chrome splits history into two tables. urls has one row per address, with a visit counter and the last visit time. visits has one row per visit, pointing to urls.id, with the exact time, the visit it came from (from_visit) and how it happened (transition). The sample is a cut-down History file with the real column names; the real tables have a few more columns.

Four live rows, rowids 1, 2, 3 and 5. Rowid 4 is missing, and the freeblock still holds it: robin removed quick-loans.example.net from the history. The deleted row's last visit time survives too. Its visit is in a freeblock of the visits table:

Idealised sample: this file was written with secure_delete off to show the SQLite mechanism. Chrome and Firefox build SQLite with secure delete enabled, so they overwrite freed cells with zeros. In real cases deleted history is found instead in the rollback journal (History-journal) or the WAL, in volume shadow copies and backups, in unallocated space of the file system, and in other artefacts (session files, cache, DNS and proxy logs). The SQLite page explains what survives when secure delete is off, as in many apps.
The visits joined with their URLs (builder output)

How did the user get there? The transition

The low byte of transition is the core type, the high bits are qualifiers. It separates a typed address from a clicked link or a page that loaded by itself, which matters when someone says "I never went there, it just opened".

Transition decoder

3 Downloads and searches

The downloads table keeps the target path, size, start and end time, whether the file was opened, and the page it came from (referrer, tab_url; the full redirect chain is in downloads_url_chains). The file itself may be long deleted; the row stays until the user clears the download list.

Searches typed into the address bar get their own table, keyword_search_terms, linked to the result page in urls. It has no INTEGER PRIMARY KEY, so all four columns are stored.

4 Firefox: places.sqlite

Firefox uses the same idea with other names: moz_places (one row per URL, with a reversed host name rev_host for fast lookups and a frecency score for the address bar) and moz_historyvisits (one row per visit). Times are PRTime, microseconds since 1970.

The visits joined with their URLs (builder output)
visit_typeMeaningvisit_typeMeaning
1LINK: followed a link6REDIRECT_TEMPORARY (302)
2TYPED: typed or picked from the address bar7DOWNLOAD
3BOOKMARK8FRAMED_LINK: link inside a frame
4EMBED: loaded inside a page9RELOAD
5REDIRECT_PERMANENT (301)

Firefox stores download details (target file, end time, size) as annotations in moz_annos, linked to the moz_places row of the download URL.

5 Open tabs: the session file

To restore tabs after a crash, Firefox writes the whole session (windows, tabs, back/forward history, scroll positions, sometimes form contents) every few seconds to sessionstore-backups/recovery.jsonlz4. The file is JSON compressed with LZ4 behind Firefox's own 12-byte header. LZ4 is simple enough to follow by hand: each sequence copies some literal bytes, then repeats a stretch of earlier output.

The decompressed JSON (builder output)

Session files can show pages that were never written to the history: a tab can be open without a new visit, and closed tabs stay in _closedTabs for a while. Chrome keeps the same kind of data in its Sessions folder (a binary "SNSS" command log).

6 Encryption, private windows, sync

7 Try it yourself

Answer from the hex views and tools above.

Visit 2 has the transition 805306373. How did robin reach the search results page?

Put the number into the transition decoder in section 2.

805306373 = 0x30000005: core type 5 GENERATED (a suggestion that was not a URL, here a search), with CHAIN_START and CHAIN_END. The search words are in keyword_search_terms: "night train vienna". Visit 3 then has from_visit 2 and type LINK: a result was clicked.

Which URL was deleted from the Chrome history?

Find the freeblock of the urls page in section 2.

https://quick-loans.example.net/apply, title "QuickLoans: apply in 5 minutes". The freeblock keeps url, title, counts and last_visit_time (2026-09-14 15:52:44 UTC). The matching visit (rowid 5, url 4) is in the freeblock of the visits page, with transition 838860801: the address was typed.

What visit_type does Firefox store for old_contacts.vcf?

Find the place ID of the .vcf URL in moz_places, then its row in moz_historyvisits.

Place 4, visit 4: visit_type 7 = DOWNLOAD, at PRTime 1,789,496,517,901,000 = 2026-09-15 18:21:57.901 UTC.

How many bytes of JSON does the session file decompress to?

The 4 bytes after the 8-byte magic, little-endian.

B9 01 00 00 = 0x1B9 = 441 bytes, from 322 bytes of LZ4 data. Repeated keys like "entries":[{"url":"https:// compress into short back-references.

These 28 bytes are the cell of visit 7 (file offset 0xF47): payload length, rowid, record header, then url, visit_time, from_visit, transition, …. Edit them and watch the decoded page:

  • The transition is 30 00 00 00 at 0xF5B. Change the last byte to 01. What does the visit claim now? Check with the transition decoder.
  • Reset, then change the url value at 0xF51 from 05 to 04. The visit now points to the deleted URL row. Why is a visit row without its URL row still worth reporting?
  • Reset, then change the first byte of visit_time at 0xF52 from 00 to 01. How far into the future does the visit move?