错误:此处未定义“ chromeWindow.state”
你能给我正确的方向吗?
chrome.runtime.onMessage.addListener(function(message,sender,sendResponse)
{
chrome.windows.get(sender.tab.windowId, function(chromeWindow) {
// chromeWindow is DEFINED HERE
console.log('sending to contentscript :', chromeWindow.state);
});
// chromeWindow.state is UNDEFINED
sendResponse(**chromeWindow.state**);
});
答案 0 :(得分:0)
chrome.runtime.onMessage.addListener(function(message,sender,sendResponse)
{
chrome.windows.get(sender.tab.windowId, function(chromeWindow) {
sendResponse(chromeWindow.state);
});
});