diff --git a/install-usercss/install-usercss.js b/install-usercss/install-usercss.js index bf1e2d3c..b061af46 100644 --- a/install-usercss/install-usercss.js +++ b/install-usercss/install-usercss.js @@ -59,6 +59,12 @@ id === tabId && url && url !== tabUrl && closeCurrentTab()); + // close the tab in case the port didn't report onDisconnect + chrome.tabs.onRemoved.addListener(id => { + if (id === tabId) { + closeCurrentTab(); + } + }); function liveReloadUpdate(sourceCode) { liveReloadPending = liveReloadPending.then(() => {