Here is my code.
chrome.runtime.onMessage.addListener( async (request: any, _sender: any, _sendResponse: any) => { if (request.message === 'getGlobalTabID') { _sendResponse({globalTabID: ServiceWorkerGlobals.globalTabID, currentTabID: _sender.tab.id}); } }, );`
I’m getting error in Production which is that sometimes the _sender.tab
has no id
, now I’m trying to look through documentation but could not find any clue why this can be the case.
getGlobalTabID
is sent from content-script.js which runs on all https
sites.
chrome.runtime.sendMessage({message: 'getGlobalTabID'}, async response => { })`
Any clue to identify why content script is even ran on a tab that has no ID?
Ideally, every tab should have ID in this scenario since the content script do not run on dev tool windows that has no tab ID.