# history Documentation: [Chrome History API](https://developer.chrome.com/docs/extensions/reference/history) A promise-based wrapper for the Chrome `history` API to manage browser history. ## Methods - [addHistoryUrl(url)](#addHistoryUrl) - [deleteAllHistory()](#deleteAllHistory) - [deleteRangeHistory(range)](#deleteRangeHistory) - [deleteHistoryUrl(details)](#deleteHistoryUrl) - [getHistoryVisits(url)](#getHistoryVisits) - [searchHistory(query)](#searchHistory) ## Events - [onHistoryVisited(callback)](#onHistoryVisited) - [onHistoryVisitRemoved(callback)](#onHistoryVisitRemoved) --- ### addHistoryUrl ``` addHistoryUrl(url: string): Promise ``` Adds the specified URL to the browser history. ### deleteAllHistory ``` deleteAllHistory(): Promise ``` Deletes all entries from the browser history. ### deleteRangeHistory ``` deleteRangeHistory(range: chrome.history.Range): Promise ``` Removes all history entries within the specified time range. ### deleteHistoryUrl ``` deleteHistoryUrl(details: chrome.history.UrlDetails): Promise ``` Deletes all occurrences of the given URL from the history. ### getHistoryVisits ``` getHistoryVisits(url: string): Promise ``` Retrieves the visit history for the specified URL. ### searchHistory ``` searchHistory(query: chrome.history.HistoryQuery): Promise ``` Searches the browser history with the given query, returning matching history items. ### onHistoryVisited ``` onHistoryVisited(callback: (result: chrome.history.HistoryItem) => void): () => void ``` Adds a listener triggered when the browser records a page visit. Returns an unsubscribe function. ### onHistoryVisitRemoved ``` onHistoryVisitRemoved(callback: (removed: chrome.history.RemovedResult) => void): () => void ``` Adds a listener triggered when URLs are removed from the history, providing details of the removal. Returns an unsubscribe function.