Your error most likely comes from the fact that you’re using Manifest V3. In MV3 the background.js file must be loaded as a service worker otherwise chrome.tabs will be undefined which is why you're getting the addListener error.
background.js
chrome.tabs
addListener