fix PortDownloader::onDisconnect

This commit is contained in:
tophf 2020-11-19 22:28:17 +03:00
parent c635f2e38c
commit 7c2b46be83

View File

@ -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();