The Chrome.history API gives this method:
deleteRange
chrome.history.deleteRange(object range, function callback)
Removes all items within the specified date range from the history. Pages will not be removed from the history unless all visits fall within the range.
(from https://developer.chrome.com/extensions/history#method-deleteRange)
My question is: How do you define the range?
I've tried using Javascript date() objects but they don't seem to work. Using simple integers doesn't work.
Edit
So it turns out that the epoch event is actually the 1st of January, 1970, 00:00:00 UTC
To get the right amount of miliseconds since then I used
var oldDate = Date.now();
for the first startDate property and
var newDate = Date.now();
for the endDate property.
In my case the coded turned out to be:
chrome.history.deleteRange( {startTime: oldDate , endTime: newDate } , function(){
console.log("Dates Removed");
});
Lots of thanks to bzlm for helping with this.