4

Deleting an entry in the Firefox history is a simple matter, but how can I add or edit a URL (or URI) in the history?

1 Answer 1

6

You can directly manipulate the SQLite database which stores the history, which you can find in the places.sqlite file in your Firefox profile folder. You can use the SQLite Manager add-on, DB Browser for SQLite, the sqlite3 software package on Linux, or another SQLite tool of your choice.

Upon the places.sqlite database, to insert a history entry, run the command:

INSERT INTO moz_places (url,title,rev_host,last_visit_date,guid,url_hash) VALUES('https://example.com/','Example Title','moc.elpmaxe.',strftime('%s','now'),GENERATE_GUID(),hash('https://example.com/'))

To update:

UPDATE moz_places SET url = 'https://example.com/', url_hash = hash('https://example.com/') WHERE id = #### -- auto-incrementing integer ID

Note that Firefox itself defines the hash and GENERATE_GUID functions, so even if you opted to use a SQLite tool other than the SQLite Manager extension, you will still need a different Firefox instance with this add-on. In this separate instance, you can run commands to compute the hash value or generate the GUID, and then copy those values in place of their calls in the previous SQL statements.

SELECT hash('https://example.com/')
SELECT GENERATE_GUID()
2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .