Documentation: Chrome History API
A promise-based wrapper for the Chrome history API to manage browser history.
- addHistoryUrl(url)
- deleteAllHistory()
- deleteRangeHistory(range)
- deleteHistoryUrl(details)
- getHistoryVisits(url)
- searchHistory(query)
addHistoryUrl(url: string): Promise<void>
Adds the specified URL to the browser history.
deleteAllHistory(): Promise<void>
Deletes all entries from the browser history.
deleteRangeHistory(range: chrome.history.Range): Promise<void>
Removes all history entries within the specified time range.
deleteHistoryUrl(details: chrome.history.UrlDetails): Promise<void>
Deletes all occurrences of the given URL from the history.
getHistoryVisits(url: string): Promise<chrome.history.VisitItem[]>
Retrieves the visit history for the specified URL.
searchHistory(query: chrome.history.HistoryQuery): Promise<chrome.history.HistoryItem[]>
Searches the browser history with the given query, returning matching history items.
onHistoryVisited(callback: (result: chrome.history.HistoryItem) => void): () => void
Adds a listener triggered when the browser records a page visit. Returns an unsubscribe function.
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.