Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

history.deleteRange()

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 history.onVisitRemoved will fire for it.

Syntax

chrome.history.deleteRange(
  range,           // object
  function() {...} // function
)

This API is also available as browser.history.deleteRange() in a version that returns a promise.

Parameters

range
object. Specification of the time range for which to delete visits.
startTime
number or string or object. A value indicating a date and time. This can be represented as: a Date object, an ISO 8601 date string, or the number of milliseconds since the epoch. Specifies the start time for the range.
endTime
number or string or object. A value indicating a date and time. This can be represented as: a Date object, an ISO 8601 date string, or the number of milliseconds since the epoch. Specifies the end time for the range.
callback
function. This function is called with no arguments, once the range has been deleted.

Browser compatibility

Chrome Edge Firefox Firefox for Android Opera
Basic support Yes No 49.0 No 33

Examples

Delete all visits made in the last minute:

const MINUTE = 60 * 1000;

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

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

Acknowledgements

This API is based on Chromium's chrome.history API. This documentation is derived from history.json in the Chromium code.

Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.

Document Tags and Contributors

 Contributors to this page: Makyen, wbamberg
 Last updated by: Makyen,