shyam
answered Nov 30 '-1 00:00
if you dealing with chrome Extension than
chrome.history object will help you get history of chrome browser
chrome.history.search({
'text': '', // Return every history item....
'startTime': oneWeekAgo // that was accessed less than one week ago.
} )
chrome.history.search({
'text': '', // Return every history item....
'startTime': oneWeekAgo // that was accessed less than one week ago.
},function(historyItems) {
// For each history item, get details on all visits.
for (var i = 0; i < historyItems.length; ++i) {
var url = historyItems.url;
alert(url);
}
});
if you dealing with firefox Extension than
[i]browser.history.search give history result
var searching = browser.history.search({
text: "",
startTime: 0,
maxResults: 1
});
searching.then(listVisits);
function listVisits(historyItems) {
if (historyItems.length) {
console.log("URL " + historyItems[0].url);
}
}