diff --git a/src/drivers/webextension/js/driver.js b/src/drivers/webextension/js/driver.js index 37f6b10e2..8d0bc6f5b 100644 --- a/src/drivers/webextension/js/driver.js +++ b/src/drivers/webextension/js/driver.js @@ -76,8 +76,12 @@ const Driver = { chrome.tabs.onRemoved.addListener((id) => delete Driver.cache.tabs[id]) - chrome.tabs.onUpdated.addListener(async (id, { url }) => { - if (url) { + chrome.tabs.onUpdated.addListener(async (id, { status }) => { + delete Driver.cache.tabs[id] + + if (status === 'complete') { + const { url } = await promisify(chrome.tabs, 'get', id) + const { hostname } = new URL(url) const cache = Driver.cache.hostnames[hostname]