code cosmetics

This commit is contained in:
tophf 2018-02-15 16:48:00 +03:00
parent 683e73ceb9
commit c564aab48f

View File

@ -55,10 +55,11 @@
}, 200); }, 200);
getTab(tabId).then(tab => (tabUrl = tab.url)); getTab(tabId).then(tab => (tabUrl = tab.url));
chrome.tabs.onUpdated.addListener((id, {url}) => chrome.tabs.onUpdated.addListener((id, {url}) => {
id === tabId && if (id === tabId && url && url !== tabUrl) {
url && url !== tabUrl && closeCurrentTab();
closeCurrentTab()); }
});
// close the tab in case the port didn't report onDisconnect // close the tab in case the port didn't report onDisconnect
chrome.tabs.onRemoved.addListener(id => { chrome.tabs.onRemoved.addListener(id => {
if (id === tabId) { if (id === tabId) {