Fork me on GitHub

Is there a way to determine client-side whether the browser tab is the current active runtime? I want to mark the tab title to indicate that it is currently being used to execute code.


as far as shadow-cljs is concerned all of them are active, it is your REPL client that is selecting which one to talk to


You can eval (set! js/document.title "EVAL HERE") or so 😛


I don't think that is what he meant


Thanks. Is there a way to get the current :client-id from the browser side? On the server side, I can call (shadow/repl-runtimes BUILD) and get a list of the current runtimes, and each of them has a :client-id that I can use to select the current run-time using (shadow/repl-runtime-select BUILD CLIENT-ID) Can I access that client-id from the browser side? So for example if I wanted to include the client-id in the title of the page.


I think I figured it out. I can just require shadow.cljs.devtools.client.env client side to get access to this information.


correct, the information is all there, set via :closure-defines for watch builds


be careful with requiring that ns though, should avoid getting it into the release build


the runtime id is also logged when the page first loads, the shadow-cljs - #<id> ready! message