它是否假设在每个内置的chrome函数中定义?
未捕获的TypeError:无法读取属性'然后'在popup.js中未定义:23
var requestCurrentTabId = {
active:true,
windowType:"normal",
currentWindow: true
};
function getCurrentTab(chromeOpenedTabsList){
window.currentTabId = chromeOpenedTabsList[0].id;
//Connect to the content_script messaging port
//on the current opened page, the extension user is visiting.
var messagePassingPort = chrome.tabs.connect(currentTabId, {name: "content_script_port"});
//Inject selection listener into Chrome PDF viewer
//after opening this popup.
console.log("Current tab:" + window.currentTabId);
}
//getCurrentTab - is a callback
chrome.tabs.query(requestCurrentTabId, getCurrentTab).then(console.log("Current tab2:" + window.currentTabId));