nbb

ag 2025-01-27T19:21:24.071909Z

Another question for using Playwright with nbb. Has anyone thought of having a Cljs REPL connected to Playwright browser instance? I want to be able to poke into elements on the page interactively. Would that be even possible?

borkdude 2025-01-27T19:48:38.313619Z

yes, why not?

borkdude 2025-01-27T19:48:57.600419Z

or do you mean, evaluate JS in the browser?

ag 2025-01-27T20:02:46.064859Z

So, we can do something like https://playwright.dev/docs/api/class-page#page-pause, right? How difficult it then to establish a browser REPL?

ag 2025-01-27T20:03:45.450739Z

So one can do things directly from the editor, e.g., (js/alert "blabla")

ag 2025-01-27T20:05:49.601459Z

I dunno, maybe there isn't much utility in all that at all, after all, one can always open devtools in the headed browser frame, but still would be very cool if that's possible.

borkdude 2025-01-27T20:16:01.636989Z

playwright lets you evaluate JS in the browser

borkdude 2025-01-27T20:16:14.801579Z

but this needs to be compiled first, nbb is an interpreter

borkdude 2025-01-27T20:16:44.377689Z

or you'd have to insert #scittle or so in the browser first and then call scittle.core.eval_string

borkdude 2025-01-27T20:16:52.633289Z

or precompile a JS string using #squint for example

borkdude 2025-01-27T20:17:03.184559Z

but seems like a hassle if it's not a lot of code

ag 2025-01-27T21:06:49.925639Z

Interesting. Thank you for the direction. If I get bored maybe I'll try