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 https://github.com/FirebaseExtended/firepad/blob/master/examples/ace.html from the https://firepad.io/ 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
(atom
{:title nil
:status nil}))
(def html
(slurp "<https://raw.githubusercontent.com/FirebaseExtended/firepad/master/examples/code.html>"))
(defn view [{:keys [title status]}]
{:fx/type :stage
:showing true
:title (str title)
:scene
{:fx/type :scene
:root
{:fx/type :v-box
:children
[{: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
(fx/create-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: "<http://firepad-gh-tests.firebaseapp.com|firepad-gh-tests.firebaseapp.com>",
databaseURL: "<https://firepad-gh-tests.firebaseio.com>"
};
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 ?
nope π