diff --git a/src/SuperCSSInject.ts b/src/SuperCSSInject.ts index 612657a..cb3632a 100644 --- a/src/SuperCSSInject.ts +++ b/src/SuperCSSInject.ts @@ -10,10 +10,12 @@ function main () { if (message.action == "inject") { updateInjectedStylesheets(message.urlList); - if (!liveReloadSocket || liveReloadSocket.readyState === WebSocket.CLOSED) { - if (liveReloadConnectionAttempts < liveReloadMaxAttempts) { - console.log("[SuperCSSInject]: Attempting to connect to Live Reload server."); - listenToLiveReload(); + if (message.urlList.length > 0) { + if (!liveReloadSocket || liveReloadSocket.readyState === WebSocket.CLOSED) { + if (liveReloadConnectionAttempts < liveReloadMaxAttempts) { + console.log("[SuperCSSInject]: Attempting to connect to Live Reload server."); + listenToLiveReload(); + } } } }