From 7c2b46be836063b3696d5b8eaed493f6a3f68769 Mon Sep 17 00:00:00 2001 From: tophf Date: Thu, 19 Nov 2020 22:28:17 +0300 Subject: [PATCH] fix PortDownloader::onDisconnect --- install-usercss/install-usercss.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install-usercss/install-usercss.js b/install-usercss/install-usercss.js index 56afae69..accb1123 100644 --- a/install-usercss/install-usercss.js +++ b/install-usercss/install-usercss.js @@ -399,8 +399,8 @@ } }); port.onDisconnect.addListener(async () => { - const tab = await browser.tabs.get(tabId); - if (!chrome.runtime.lastError && tab.url === initialUrl) { + const tab = await browser.tabs.get(tabId).catch(() => ({})); + if (tab.url === initialUrl) { location.reload(); } else { closeCurrentTab();