Perhaps you have ever wanted to know exactly when and how often you have visited a particular website. Whether to document your working hours, to track a search or simply to better understand your online habits - there are many reasons to query and filter more detailed information about your web activities.

Fortunately, Firefox stores more information than is displayed in the history - namely in an SQLite-Database-file called places.sqlite.
This information can be accessed with any database client that supports access to SQLite databases. Since I use the IntelliJ development environment on a daily basis, I personally use the IntelliJ Database Explorer. All you have to do here is add a new SQLite data source and enter the path to the places.sqlite enter. In Windows this is under C:\Users\<Benutzername>\AppData\Roaming\Mozilla\Firefox\Profiles\<Profilordner>\places.sqlite
e.g. C:/Users/mfischer/AppData/Roaming/Mozilla/Firefox/Profiles/8absuz37.default-release/places.sqlite.
In the SQL console window, you can now use a join to access the tables moz_places and moz_historyvisits execute any queries.
Use the following SQL command, for example, to determine all history entries for the current day:
SELECT
datetime(v.visit_date / 1000000, 'unixepoch', 'localtime') AS visit_date,
p.title,
p.url
FROM
moz_places p
JOIN moz_historyvisits v ON p.id = v.place_id
WHERE date(datetime(v.visit_date / 1000000, 'unixepoch', 'localtime')) = date('now', 'localtime')
ORDER BY visit_date DESC;
Example output:
| visit_date | title | url |
|---|---|---|
| 2024-08-26 15:58:12 | What comes after Scrum? An outlook on the future of agile methods - Business Software and IT Blog - We shape digital value creation | https://staging.blog.doubleslash.de/software-technologien/it-projektmanagement/was-kommt-nach-scrum-ein-ausblick-auf-die-zukunft-agiler-methoden |
| 2024-08-26 15:50:50 | Secure Password Share from doubleSlash | https://www.secure-password-share.de/en/ |
| 2024-08-26 15:50:43 | doubleSlash Net-Business GmbH | https://www.doubleslash.de/en/ |
| 2024-08-26 15:50:38 | doubleSlash IT Business and Software Blog | https://staging.blog.doubleslash.de/ |
| 2024-08-26 15:50:29 | What comes after Scrum? An outlook on the future of agile methods - Business Software and IT Blog - We shape digital value creation | https://staging.blog.doubleslash.de/software-technologien/it-projektmanagement/was-kommt-nach-scrum-ein-ausblick-auf-die-zukunft-agiler-methoden |
| 2024-08-26 15:50:19 | doubleSlash IT Business and Software Blog | https://staging.blog.doubleslash.de |
| 2024-08-26 15:50:19 | http://staging.blog.doubleslash.de/ | |
| 2024-08-26 15:50:03 | test - Google Search | https://www.google.com/search?client=firefox-b-d&q=test |
If instead you want to view the entire history using AND- or OR-queries via URL and title, this can be done as follows, for example:
SELECT
datetime(v.visit_date / 1000000, 'unixepoch', 'localtime') AS visit_date,
p.title,
p.url
FROM
moz_places p
JOIN moz_historyvisits v ON p.id = v.place_id
WHERE (
p.url LIKE '%blog%'
AND p.url LIKE '%doubl%'
AND lower(p.title) LIKE '%scrum%'
) OR (
lower(p.title) LIKE '%agile%'
AND p.url NOT LIKE '%jira%'
)
ORDER BY visit_date DESC;
Addendum
If you also want to add a column that only contains the domain, you can simply adapt the above statements as follows:
SELECT
...
substr(
p.url,
instr(p.url, '//') + 2,
instr(substr(p.url, instr(p.url, '//') + 2), '/') - 1
) AS domain
FROM
...
Conclusion
Firefox stores much more information about your web activities than the history shows at first glance. A database client makes it relatively easy to query this data in detail.
Cover image generated with the help of ChatGPT.



