From c564aab48ffd5d8f8fb1b502c2af301abc2dba8c Mon Sep 17 00:00:00 2001 From: tophf Date: Thu, 15 Feb 2018 16:48:00 +0300 Subject: [PATCH] code cosmetics --- install-usercss/install-usercss.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/install-usercss/install-usercss.js b/install-usercss/install-usercss.js index b061af46..a0c21e7f 100644 --- a/install-usercss/install-usercss.js +++ b/install-usercss/install-usercss.js @@ -55,10 +55,11 @@ }, 200); getTab(tabId).then(tab => (tabUrl = tab.url)); - chrome.tabs.onUpdated.addListener((id, {url}) => - id === tabId && - url && url !== tabUrl && - closeCurrentTab()); + chrome.tabs.onUpdated.addListener((id, {url}) => { + if (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) {