I am trying to get the most visited sites in my chrome extension. I have been through Chrome Extension Developer Documentation.
When I trying to get the property topSites
from the chrome
object, it returning undefined
. But as per documentation it available since Chrome 36.
Even I added permission to access topSites
in manifest.json
.
//Load top sites
function getTopSites() {
chrome.topSites.get((top) => {
console.log(top);
});
}
getTopSites()
When I do print chrome
object I find nothing property topSites
. But documentation mention topSites
available.
//Load top sites
function getTopSites() {
console.log(chrome);
};
getTopSites()
Output in Microsoft Edge
"permissions": [
"activeTab",
"storage",
"topSites"
]
I am trying to console the output in the browser's console.
Could anyone tell me what's the problem?