close the source tab in case the port didn't report onDisconnect

fixes #349
This commit is contained in:
tophf 2018-02-15 16:47:42 +03:00
parent 44a11508ff
commit 683e73ceb9

View File

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