history.deleteRange() is what history cleaner uses. It allows you to specify a date range and delete all visits within that range. This API does not allow for any finer filtering.
browsingData.removeHistory() does allow you to specify additional filters, such as a list of hostnames to remove. However, it does not allow you to specify a complete date range. It only lets you set a "since" date. The browsing data APIs are used for deleting recent browsing data, not old browsing data. This is the opposite of what is needed for History Cleaner.
Because of this, anything that requires using the browsing data API is not viable.
This includes cache, cookies, form data, downloads, etc.
While deleting downloads with browsingData is not viable, I believe deleting older download history should be possible with downloads.erase(), though this will require a new permission. (#2)
13
Probably #16
history.deleteUrl() deletes all visits of a URL. There is no way to specify deleting only older visits of a URL. Using a combination of history.search() and history.getVisits(), you can enumerate all of the visits to a specific URL, but you can't delete a specific visit.
Because of this, it means it is impossible to implement certain features, such as:
12
32
3
Keeping statistics about how many history entries were deleted
(Some of these may be possible when deleting all history. #32 is trivial using browsingData, for instance. However, these can't be done while only deleting old history)
There are three ways to delete history in WebExtensions:
history.deleteRange()
browsingData.removeHistory()
history.deleteUrl()
history.deleteRange()
is what history cleaner uses. It allows you to specify a date range and delete all visits within that range. This API does not allow for any finer filtering.browsingData.removeHistory()
does allow you to specify additional filters, such as a list of hostnames to remove. However, it does not allow you to specify a complete date range. It only lets you set a "since" date. The browsing data APIs are used for deleting recent browsing data, not old browsing data. This is the opposite of what is needed for History Cleaner.Because of this, anything that requires using the browsing data API is not viable.
browsingData
is not viable, I believe deleting older download history should be possible withdownloads.erase()
, though this will require a new permission. (#2)13
history.deleteUrl()
deletes all visits of a URL. There is no way to specify deleting only older visits of a URL. Using a combination ofhistory.search()
andhistory.getVisits()
, you can enumerate all of the visits to a specific URL, but you can't delete a specific visit.Because of this, it means it is impossible to implement certain features, such as:
12
32
3
(Some of these may be possible when deleting all history. #32 is trivial using
browsingData
, for instance. However, these can't be done while only deleting old history)