You are viewing information archived from on 2015-08-04.

Find As You Type

Find As You Type (formerly called Type Ahead Find) is a feature that allows quick web page navigation when you type a succession of characters in the body of the displayed page (not in an edit box of or drop down list). The coding of Find As You Type was contributed to Mozilla by Netscape Corporation.


  • Type several characters into the active browser window to navigate to any link with that text in it
  • If you repeat the same character, it will start to cycle through all the links that begin with that character. However, if it can find a match with the exact string you've typed, such as "oo" in "woods" it will go there first. Typing "o" more times will then cycle through the links that start with "o".
  • Use the backspace key to undo the last character typed
  • Type a ' before your string to search only links. Type / before your string to search all text.
  • You can use the text search field to get to buttons, text boxes and other form controls. Just search for the text right before it, and then press Tab when to move from there.
  • To cancel a find, change focus or scroll, press Escape, or wait for the timeout
  • Press Accel+G or F3 to use "find next". Press Accel+Shift+G or Shift+F3 to find previous, with the current string you've typed. This respects the current "linksonly" setting. Note: 'accel' means Ctrl on Windows, and Cmd on Mac. On Unix, 'accel' usually means Ctrl, but it can be set to Alt.
  • Works with any Gecko HTML content window - embedded clients, IM conversation window, help, etc.
  • works with IME for input of Chinese, Japanese, Korean, etc.
  • When focused on a link, the following keys will work:
    • Enter - activate the link
    • Shift+Enter - save the page that the link points to
    • Ctrl+Enter (Cmd+Enter on Mac) - open the link in a new window
    • Insert - open the link in a new foreground or background tab, depending on the "Load links in the background" pref. under Preferences - Navigator - Tabbed Browsing.
    • Shift+Insert - same as Insert, but does the opposite of the foreground/background pref

Deactivating it

Find As You Type is currently part of the default install. To turn it off, use:

user_pref ("accessibility.typeaheadfind", false);

Or, to remove it completely, find all files in your installation subdirectories that match *typeaheadfind*, and delete those files.

Reactivating it

To turn it back on, use:

user_pref ("accessibility.typeaheadfind", true);


There is a new Keyboard Navigation preferences panel, under Preferences - Advanced. It contains a few Find As You Type Preferences, such as startup options, and whether the timeout or sound should be enabled.

If you want to fine tune your settings by hand, Find As You Type uses the following prefs as defaults, which can be changed in your prefs.js file:

user_pref("accessibility.typeaheadfind.autostart", true); // If true, just typing can automatically start Find As You Type. If false, you must hit / (find text) or ' (find links) before your search

user_pref("accessibility.typeaheadfind.linksonly", true); // If true, defaults to linksonly as user starts typing. User can override it by pressing / for all text, or ' for links only

user_pref("accessibility.typeaheadfind.startlinksonly", false);    // If true, matches only to the start of links when searching only for links

user_pref("accessibility.typeaheadfind.timeout", 3000); // if > 0, # of milliseconds since user last typed, before the find is cancelled.

user_pref("ui.textSelectBackgroundAttention", "#rrggbb"); // where rrggbb is the hex color you want for found text.

user_pref("accessibility.typeaheadfind.enablesound", false); // error sound on? (it is currently off by default for Linux/Unix, on by default for other platforms)

user_pref("accessibility.typeaheadfind.soundURL", "filename"); // Specify your own wav file for the error sound, or use the string "default" for the default sound or "beep" for the system beep

How it works

The source is checked into mozilla/extensions/typeaheadfind

Basically when it gets initialized as a component, it starts listening for domwindowopened events via nsIWindowWatcher, and attaches a keypress listeners to these windows. Whenever a keypress occurs in a new window, it checks to see if Find As You Type should auto-activate in that window (that is, if it's not an editor or mailnews window, etc.).

If autostart is disabled (when / or ' are required to start typeaheadfind), it receives the command through the nsICommand interface. The commands are specified in htmlBindings.xml

After that, it simply keeps track of the characters typed and uses the low level nsIFind interface to see if it can find that text. It actually does this twice for a page, so that it can prefer text that's visible on the page.

TypeAheadFind for Embeddors

TypeAheadFind is now an option for embeddors (as of September 28, 2002).

  1. Find the file called mozilla/embedding/config/basebrowser-[yourplatformname] and uncomment the 2 lines that list files (a binary file and an .xpt file).
  2. cd mozilla/embedding/config
  3. make

You should now have typeaheadfind enabled in your dist/Embed directory.

To Be Done

We Like Feedback

Requests for Enhancement, Bug Reports

Please create a Bugzilla bug report, under the Component "Keyboard: Find as you Type".


Try out our Find As You Type tests, and report any problems you see! Visit the Find As You Type - QA Page.