Fork me on GitHub

Hello! I'm trying cljfx those days 🙂 it is really great work!


I'm trying to use webviews, but I'm struggling a bit, here is my code (based on exemple 39) I'm trying to render an from the website

(ns moi.firepad
  (:require [cljfx.api :as fx]
            [cljfx.ext.web-view :as fx.ext.web-view])
  (:import [javafx.scene.web WebEvent]))

;; this example shows how to use web view extensions that provide access to
;; WebEngine object that is used for obtaining web page information and
;; controlling it

(def *state
   {:title nil
    :status nil}))

(def html
  (slurp ""))

(defn view [{:keys [title status]}]
  {:fx/type :stage
   :showing true
   :title (str title)
            {:fx/type :scene
                      {:fx/type :v-box
                                [{:fx/type fx.ext.web-view/with-engine-props
                                  :desc {:fx/type :web-view}
                                  :props {:content html
                                          :on-title-changed #(swap! *state assoc :title %)
                                          :on-status-changed #(swap! *state assoc :status (.getData ^WebEvent %))}}
                                 {:fx/type :label
                                  :text (str status)}]}}})

(def renderer
   :middleware (fx/wrap-map-desc #'view)))

(fx/mount-renderer *state renderer)
It renders a blank window, I don't know what is going on... any help would be appreciated 🙂


@pbaille I haven’t tried to run it, but your html contains this:

//// Initialize Firebase.
      //// TODO: replace with your Firebase project configuration.
      var config = {
        apiKey: '<API_KEY>',
        authDomain: "",
        databaseURL: ""
maybe you need to use correct API key for that page to show anything?


Ho! my bad, I have not seen that! I will try again. thank you a lot


Is there a way to have some kind of devtools within web views ?