Isn't it suppose to be defined in every built-in chrome function?
Uncaught TypeError: Cannot read property 'then' of undefined at 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));