function onGot(historyItems) {
for (const item of historyItems) {
console.log(item.url);
console.log(new Date(item.lastVisitTime));
}
}
browser.history.search({ text: "" }).then(onGot);history.search() / notebook
history.search()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
function onGot(historyItems) {
for (const item of historyItems) {
console.log(item.url);
console.log(new Date(item.lastVisitTime));
}
}
browser.history
.search({
text: "",
startTime: 0,
})
.then(onGot);function onGot(historyItems) {
for (const item of historyItems) {
console.log(item.url);
console.log(new Date(item.lastVisitTime));
}
}
browser.history
.search({
text: "mozilla",
startTime: 0,
maxResults: 1,
})
.then(onGot);