Browser History

Introduction

A redesign of the Global History component in Firefox using mozStorage and supplying additional capabilities to application developers. Questions about the history re-write can be sent to brettw<AT>gmail<DOT>com.

Separate but related is the Annotations service which can store arbitrary information about a page for extension developers.

New capabilities

The current history system uses the annoying Mork database format, and is impossible to find and difficult to use. Most people don't use it at all, and when they do, it can be difficult to find what you are looking for.

The new history system will hopefully fulfill the following goals:

  • Store much more history than the current default (9 days) and do so with minimal performance penalty.
  • Be faster and more efficient.
  • Have a better UI that people will want to use, and that allows them to find what they are looking for. The current history sidebar is too cramped and does not offer enough capabilities.
  • Store each time you visit a page, rather than just the most recent. This allows us to answer simple questions such as "What did I visit yesterday?" which is currently impossible.

Database design

The history will be stored in 2 SQL tables: "history" and "historytransitions".

The "history" table essentially duplicates the functionality of the current mork history table: It contains:

  • Unique ID (primary key)
  • URL
  • Title
  • Visit count
  • Last visit date
  • Host name (see below)
  • Hidden (bool)
  • Typed (bool)

Note that the host name is stored backwards, unlike the current table. This is done so that it can be indexed alphabetically and we can quickly pull out all pages within any "mozilla.org" domain by asking for hostname fields that begin with "gro.allizom." A period is always appended to the reversed hostname.

The second table stores transitions between pages, which is information unavailable now.

  • Source page ID
  • Destination page ID
  • Time
  • Transition type

Transition type will hopefully contain info about whether the link was clicked, opened in new tab/window, typed, etc.