      libs
      (not-empty (mapv :file foreign-libs)))))
 
+;; open url build middleware
+
+(def open-url-once (memoize clojure.java.browse/browse-url))
+
+(defn open-urls [build-state]
+  (when-let [urls (not-empty
+                (-> build-state
+                    :build-config
+                    :figwheel
+                    :open-urls))]
+    (doseq [url urls] (open-url-once url))))
+
+(defn open-urls-hook [build-fn]
+  (fn [build-state]
+    (build-fn build-state)
+    (open-urls build-state)))
+
 (defn extract-data-for-deadman-app [build-config e]
   (-> build-config
       :figwheel

                           :exception-data (cljs-ex/parse-exception e)}])))

(defn deadman-header-comment []
  "/* NOT YOUR COMPILED CLOJURESCRIPT - TEMPORARY FIGHWEEL GENERATED PROGRAM 
 * This is only created in the case where the compile fails and you don't have a 
 * generated output-to file.
 */")

           (slurp #_(io/file (str "../sidecar/resources/compiled-utils/figwheel-helper-deploy.js"))
                  (io/resource "compiled-utils/figwheel-helper-deploy.js"))))))

(defn deadman-output-to-file? [output-to-file]
  (when (.exists (io/file output-to-file))
    (when-let [first-line (first (line-seq (io/reader output-to-file)))]
      (re-matches #".*FIGWHEEL BAD COMPILE.*"  (str first-line)))))

;; this is just used for the initial build
(defn catch-print-hook
