我希望在我的应用程序中获取所有打开的标签页面,我在代码下面尝试了
function list_session(callback) {
chrome.windows.getAll({populate : true}, function (window_list) {
var list = [];
for(var i=0;i<window_list.length;i++) {
list = list.concat(window_list[i].tabs);
}
console.log(list);
if(callback) {
callback(list);
}
});
}
list_session(function(tab_list) {
//use array of tabs
console.log(tab_list);
});
我收到以下错误
Cannot read property 'getAll' of undefined
请帮助我继续前进..
答案 0 :(得分:1)