This could be why there is tab undefined in last post of Constant CPU usage, increasing memory usage, killing the browser
There is this code:
browser.tabs.onUpdated.addListener((tabId, changeInfo, tabInfo) => {
function onFound(tabs) {
**let tab = tabs[0];**