I made a program that is supposed to tell you your entire search history, but it returns an error.
function onGot(historyItems) {
for (item of historyItems) {
window.alert(item.url);
}
}
var searching = chrome.history.search({
text: "",
startTime:0
});
searching.then(onGot);
That was my js
I get an error that says
ERROR: {TypeError: "Cannot read properties of undefined (reading 'search')"}
I don't know what is wrong in my code, and I've tested it on chrome on windows and IOS, both return this error. What can I do to stop this error from occurring? (Made with HTML, js, and CSS project)