Fix stuck cache

main
Elbert Alias 4 years ago
parent 1c716621d8
commit 40fe819220

@ -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]