Search code examples
sqlitefirefoxbrowser-history

How to obtain the MIME type of URLs in the Firefox history?


Firefox keeps its list of visited URLs on disk in a SQLite database, so it is easy to write a script to output that list in CSV format.

However, I need to select among URLs based on MIME type (I want to recover my list of RSS/Atom feeds).

Does Firefox maintain that information anywhere?

(I can write a script to issue a HEAD request on each URL in the list and record the MIME type returned. With 47K URLs, that isn't the politest thing to do, so I'm looking for a way to avoid it.)


Solution

  • Short answer: Sadly it looks like impoliteness may be the only way... Firefox doesn't seem to store this information in its history.

    Workings: I dumped my own places.sqlite database to a text file using the following commands:

    .open places.sqlite
    .mode csv
    .headers on
    .out places.dmp
    .dump
    

    Searching through this file in a text editor reveals there are no references to text/ in the data and the only usage of mime_type in the schema is in unrelated tables (moz_favicons, moz_annos and moz_items_annos, each of which serves a different purpose).