I’m currently developing an extension that will provide a better alternative to standard Edge history page. For accessing the history I used chrome.history
, which, as I previously thought, solved my problem. However, as I increased maxResults
property of the query, at some point it just stopped returning more results (around a 100, I definitely have more than 100 history items), from which I concluded that it only returns the items that were added after the last launch of the browser. I comfirmed that by restarting the browser and saw an empty result. Currently, I’m using this piece of code to get history items:
function displayHistory(items, filter, main) {
items.processingDone = false;
chrome.history.search(
{
text: filter,
maxResults: 1000
},
(history) => {
undisplayAll(items, main);
for (const i of history) {
displayItem(items, i, main);
}
items.processingDone = true;
}
);
}
The question is: How to access the whole history?
2
Answers
You could try promisifying the API call:
And then implement a paging call:
Here is how you can use it:
Even though I can get more history items than the number from current session,
chrome.history
seems to retrieve far less items than my actual counts of entire browsing history. According to https://issues.chromium.org/issues/40229042#comment16, it seems to be a problem that hasn’t been fixed yet, but they didn’t mention anything about "current session".I suggest you create a new post there to let the Dev Team know about the problem, both the old one from back in the day and the new one you just found.