Rayquaza01 / HistoryCleaner

Firefox addon that deletes history older than a specified amount of days.
MIT License
78 stars 6 forks source link

[INFO] What does "Impossible" mean? #38

Open Rayquaza01 opened 2 weeks ago

Rayquaza01 commented 2 weeks ago

There are three ways to delete history in WebExtensions:

  1. history.deleteRange()
  2. browsingData.removeHistory()
  3. 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.

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:

(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)