Extension History, Reading List, and URL Navigation APIs
How browser extension APIs use URL fields in history, reading list, bookmarks, omnibox, and top sites, with query limits and transition types.
This page summarizes Chrome extension API documentation for APIs where a page URL is the main identifier or payload. Most of the material is from the browser.* namespace (Manifest V3); the same concepts appear in the older chrome.* APIs. Use it when you are building an extension that saves links, searches browsing history, or customizes address-bar suggestions and need to know required fields, formats, and limits.
History API: search history by URL and time
Section titled “History API: search history by URL and time”The history API exposes past navigations. A HistoryItem is one row in search results; each physical visit is a VisitItem with transition metadata.
What is a HistoryItem?
Section titled “What is a HistoryItem?”An object encapsulating one result of a history query.
— Chrome, browser.history
| Property | Type | Meaning |
|---|---|---|
id |
string | Unique identifier for the item |
url |
string optional | URL the user navigated to |
title |
string optional | Page title at last load |
lastVisitTime |
number optional | Last load time (ms since epoch) |
visitCount |
number optional | Total visits to this page |
typedCount |
number optional | Visits by typing the URL in the address bar |
How do I query history with text and date range?
Section titled “How do I query history with text and date range?”history.search() accepts a query object:
| Parameter | Type | Notes |
|---|---|---|
text |
string | Free-text query; empty string returns all pages (within other limits) |
startTime |
number optional | Only visits after this time (ms); defaults to the last 24 hours if omitted |
endTime |
number optional | Only visits before this time |
maxResults |
number optional | Cap on results; default 100 |
A free-text query to the history service. Leave this empty to retrieve all pages.
— Chrome, browser.history
For delete or other operations that target one row, url must match the format returned from history.search(), not an arbitrary normalized form you invent.
The URL for the operation. It must be in the format as returned from a call to history.search().
— Chrome, browser.history
history.deleteRange() uses a range with required startTime and endTime (both ms since epoch) for items added in that window.
What does VisitItem tell me about one visit?
Section titled “What does VisitItem tell me about one visit?”An object encapsulating one visit to a URL.
— Chrome, browser.history
| Property | Type | Meaning |
|---|---|---|
visitId |
string | Unique ID for this visit |
id |
string | ID of the parent HistoryItem |
url |
(via parent item) | Destination of the visit |
visitTime |
number optional | When the visit occurred (ms) |
referringVisitId |
string | Visit ID of the referrer |
transition |
TransitionType |
How navigation happened |
isLocal |
boolean | Chrome 115+: true if the visit was on this device, false if synced from another device |
Transition types: how the user reached a URL
Section titled “Transition types: how the user reached a URL”The MV2 history reference documents transition values on each visit—for example whether the user clicked a link, typed an address, or submitted a form.
The history API uses a transition type to describe how the browser navigated to a particular URL on a particular visit. For example, if a user visits a page by clicking a link on another page, the transition type is “link”.
— Chrome, chrome.history
| Transition | Typical case |
|---|---|
link |
Clicked a link on another page |
typed |
Typed URL or explicit navigation in the address bar |
generated |
Chose a suggestion that did not look like a raw URL |
auto_bookmark |
UI suggestion (e.g. menu) |
form_submit |
Form submit (not all scripted submits) |
reload |
Reload, session restore, or reopen closed tab |
keyword / keyword_generated |
Keyword search shortcuts |
auto_subframe / manual_subframe |
iframe navigations (auto vs user-driven) |
auto_toplevel |
Command line or start page |
When filtering history for “real” user navigations, many extensions drop auto_subframe and ad iframes unless they explicitly care about subframe URLs.
Reading list API: URL as the primary key
Section titled “Reading list API: URL as the primary key”The reading list API lets an extension mirror Chrome’s reading list: save articles, list them, mark read, and remove entries.
How are reading list items identified?
Section titled “How are reading list items identified?”Items are keyed by URL. This includes the hash and query string.
— Chrome, browser.readingList
Two URLs that differ only after ? or # are different entries. Normalizing URLs (stripping tracking params) can accidentally create duplicates or fail updates.
Items in the reading list are not in any guaranteed order.
— Chrome, browser.readingList
Do not assume sort order from query(); sort by creationTime or lastUpdateTime in your own UI if needed.
Entry fields and CRUD methods
Section titled “Entry fields and CRUD methods”Each entry includes title, url, and hasBeenRead. Query results can also expose creationTime and lastUpdateTime (ms since 1 Jan 1970).
| Method | Behavior |
|---|---|
addEntry() |
Adds an entry if it does not already exist |
updateEntry() |
Updates title, URL, or read flag if the entry exists |
removeEntry() |
Removes by url |
query() |
Optional filters: url, title, hasBeenRead |
Adds an entry to the reading list if it does not exist.
— Chrome, browser.readingList
Updates a reading list entry if it exists.
— Chrome, browser.readingList
Example pattern from the docs:
await browser.readingList.addEntry({ title: "New to the web platform in September | web.dev", url: "https://developer.chrome.com/", hasBeenRead: false});Marking read only requires the same url key:
await browser.readingList.updateEntry({ url: "https://developer.chrome.com/", hasBeenRead: true});Omitted optional fields on updateEntry() keep the previous title or read state.
Bookmarks API: change events and URL updates
Section titled “Bookmarks API: change events and URL updates”The bookmarks API uses string id for nodes. When a bookmark changes, the event payload includes changes with optional title and url—useful for syncing or validating that the stored link still matches what the user sees.
Omnibox API: what goes in the address bar vs the dropdown
Section titled “Omnibox API: what goes in the address bar vs the dropdown”The omnibox API customizes address-bar suggestions. Each SuggestResult separates what the user sees from what navigation uses:
| Property | Role |
|---|---|
content |
Text placed in the URL bar and sent to the extension when the user picks the row |
description |
Dropdown label; may use url, match, and dim markup for highlighting |
deletable |
Chrome 63+: whether the user can delete the suggestion |
The text that is put into the URL bar, and that is sent to the extension when the user chooses this entry.
— Chrome, browser.omnibox
content should be a valid navigable target (often a full URL). description is display-only; confusing the two produces suggestions that look right but navigate elsewhere.
Top sites and other URL helpers
Section titled “Top sites and other URL helpers”topSites
Section titled “topSites”browser.topSites returns MostVisitedURL objects—shortcuts like the new tab page—with title and url.
An object encapsulating a most visited URL, such as the default shortcuts on the new tab page.
— Chrome, browser.topSites
management (shortcut apps)
Section titled “management (shortcut apps)”browser.management can create launchers where url must use http or https only, plus a title for the generated app.
runtime uninstall URL
Section titled “runtime uninstall URL”browser.runtime accepts an optional url (http/https) opened after uninstall; use an empty string to open nothing.
Legacy chrome.apps webview
Section titled “Legacy chrome.apps webview”The webview tag (legacy packaged apps) loads content via dataUrl, sets baseUrl for relative links, and optional virtualUrl shown in the address bar while other content loads—distinct from extension page URLs in history.
Common mistakes when using URL fields
Section titled “Common mistakes when using URL fields”- History delete/update URL mismatch — Passing a canonicalized URL instead of the exact string from
history.search()silently fails or hits the wrong row. - Reading list duplicates — Treating
https://example.com/aandhttps://example.com/a?utm=1as one item; the API does not. - History time window — Forgetting that default
startTimeis 24 hours, so “show all history” queries look empty unlessstartTimeis set to0or an old timestamp. - Omnibox
descriptionvscontent— Putting the destination only in styled description markup without settingcontent. - Required schemes — Management and runtime uninstall URLs reject non-http(s) schemes.
How to check this on your site
Section titled “How to check this on your site”- Load the extension unpacked, open the service worker or background page console, and call
browser.history.search({ text: '', startTime: 0, maxResults: 5 }); confirm each result’surlmatches what appears inchrome://history. - Add a reading list entry with
browser.readingList.addEntry(), openchrome://reading-list, and verify the sameurl(including query and hash) appears once. - Exercise omnibox suggestions and confirm the chosen row sets the address bar to the
contentvalue from browser.omnibox. - For visit analytics, log
transitiononVisitItemfrom browser.history and compare a known click navigation (link) with a typed URL (typed). - You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about.