[英]Trying to use Chrome API topSites
I am currently trying to get the list of top visited sites using the Chrome API, topSites .我目前正在尝试使用 Chrome API topSites 获取最常访问的网站列表。 With the code below in my background page I am getting no luck so far, with the error code
Cannot read property 'get' of undefined
.在我的背景页面中使用下面的代码到目前为止我没有运气,错误代码
Cannot read property 'get' of undefined
。 For reference, I already have the API listed in my manifest.json
under permissions.作为参考,我已经在
manifest.json
列出了权限下的 API。
background.js
chrome.topSites.get((arr) => {
console.log(arr);
});
Found the solution for my problem, I did not update the extension package to use the chrome API topSites.找到了我的问题的解决方案,我没有更新扩展包以使用 chrome API topSites。 I had to press
load unpacked
and update.我不得不按下
load unpacked
和更新。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.