   ([]
    (browser-repl {}))
   ([{:keys [verbose open] :as opts}]
-   (let [{:keys [supervisor config http] :as app}
-         (runtime/get-instance!)
-
-         worker
-         (or (super/get-worker supervisor :browser-repl)
-             (let [worker
-                   (start-browser-repl* app)
-
-                   out-chan
-                   (-> (async/sliding-buffer 10)
-                       (async/chan))]
-
-               (go (loop []
-                     (when-some [msg (<! out-chan)]
-                       (try
-                         (util/print-worker-out msg verbose)
-                         (catch Exception e
-                           (prn [:print-worker-out-error e])))
-                       (recur)
-                       )))
-
-               (worker/watch worker out-chan)
-               (worker/compile! worker)
-
-               (let [url (str "http" (when (:ssl http) "s") "://localhost:" (:port http) "/browser-repl-js")]
-                 (try
-                   (browse-url url)
-                   (catch Exception e
-                     (println
-                       (format "Failed to open Browser automatically.\nPlease open the URL below in your Browser:\n\t%s" url)))))
-               worker))]
+   (let [{:keys [supervisor http] :as app} (runtime/get-instance!)]
+
+     (or (when-let [{:keys [state-ref] :as worker}
+                    (super/get-worker supervisor :browser-repl)]
+
+           (if-not (-> @state-ref :runtimes empty?)
+             worker ;; browser still connected. continue using previous worker.
+             (do (super/stop-worker supervisor :browser-repl)
+                 nil)))
+
+         ;; no previous worker, start new one
+         (let [worker
+               (start-browser-repl* app)
+
+               out-chan
+               (-> (async/sliding-buffer 10)
+                   (async/chan))]
+
+           (go (loop []
+                 (when-some [msg (<! out-chan)]
+                   (try
+                     (util/print-worker-out msg verbose)
+                     (catch Exception e
+                       (prn [:print-worker-out-error e])))
+                   (recur)
+                   )))
+
+           (worker/watch worker out-chan)
+           (worker/compile! worker)
+
+           (let [url (str "http" (when (:ssl http) "s") "://localhost:" (:port http) "/browser-repl-js")]
+             (try
+               (browse-url url)
+               (catch Exception e
+                 (println
+                   (format "Failed to open Browser automatically.\nPlease open the URL below in your Browser:\n\t%s" url)))))
+           worker))
 
      (repl :browser-repl)
      )))

           (go (alt!
                 *nrepl-quit-signal*
                 ([_]
                   :quit)

                 proc-stop
                 ([_]
                   (*nrepl-worker-exit*)
                   :quit)))

           ;; calling (node-repl) in a REPL will cause the stdout and the repl prn forward
           ;; to both print which is not what we want

                         (alt! :priority true
                           chan
                           ([msg]
                            (when (some? msg)
                              (case (:type msg)
                                :repl/out
                                (do (println (:text msg))
                                    (flush))

                                :repl/err
                                (binding [*out* *err*]
                                  (println (:text msg))
                                  (flush))

                                :ignored)
                              (recur)
                              ))

                           quit
                           ([_] :quit)))
