history.deleteAll()

Deletes all visits from the browser's history.

This function triggers history.onVisitRemoved just once, with allHistory set to true and an empty urls argument.

This is an asynchronous function that returns a Promise.

Syntax

var deletingAll = browser.history.deleteAll()

Parameters

None.

Return value

A Promise will be fulfilled with no parameters when all history has been deleted.

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
deleteAll
Yes
79
49
?
Yes
No
?
?
No
?
?
?

Examples

Delete all history when the user clicks a browser action:

function onDeleteAll() {
  console.log("Deleted all history");
}

function deleteAllHistory() {
  var deletingAll = browser.history.deleteAll();
  deletingAll.then(onDeleteAll);
}

deleteAllHistory();

Note: 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.

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/history/deleteAll