How to get browsing history using the story API in the Chrome extension

How do I get the URLs of recently visited tabs using the hrome.history APIs, in particular the last 10 visited URLs?

+4
source share
1 answer

Pass an empty string as a request to the search () method of the chrome.history API . For example, this will log the 10 most recently visited URLs to the console:

chrome.history.search({text: '', maxResults: 10}, function(data) {
    data.forEach(function(page) {
        console.log(page.url);
    });
});
+19
source

All Articles