docs.rodeo

MDN Web Docs mirror

history.deleteRange()

{{AddonSidebar}} 

Removes all visits to pages that the user made during the given time range. If this removes all visits made to a given page, then the page will be no longer appear in the browser history and {{WebExtAPIRef("history.onVisitRemoved")}}  will fire for it.

This is an asynchronous function that returns a Promise.

Syntax

let deletingRange = browser.history.deleteRange(
  range           // object
)

Parameters

Return value

A Promise will be fulfilled with no parameters when the range has been deleted.

Browser compatibility

{{Compat}} 

Examples

Delete all visits made in the last minute:

const MINUTE = 60 * 1000;

function oneMinuteAgo() {
  return Date.now() - MINUTE;
}

browser.history.deleteRange({
  startTime: oneMinuteAgo(),
  endTime: Date.now(),
});

{{WebExtExamples}} 

[!NOTE] This API is based on Chromium’s chrome.history API. This documentation is derived from history.json in the Chromium code.

In this article

View on MDN