Open sabrehagen opened 5 years ago
Short answer is yes this is possible, but requires some changes (not sure the size of em just yet, either).
https://github.com/bengreenier/browserd/blob/74110ed3c02a8fc04ee103398814fdfcbc4ce27c/components/stream-provider/src/node/application.ts#L95 would have to go, as we won't create a browser window ourselves to host the experience. then the captureWindowTitle
would need to be passed, and match the window name of the process you want to capture.
https://github.com/bengreenier/browserd/blob/74110ed3c02a8fc04ee103398814fdfcbc4ce27c/components/stream-provider/src/node/application.ts#L116 which eventually chains to the actual window enumeration and filtering logic:
At that point, you should be able to grab the window frames. The last tricky bit is mapping input, and i'm not sure our current approach allows doing this across different input windows...you'd have to see if this code
that uses the sendInputEvent call works on processes that aren't owned by our application handle. If it does work, great input is easy - our code may even just work. However, if it doesn't...
Well, if our existing input approach doesn't work you've probably got to look at shelling out to some OS helper that can simulate input on an OS scale. I played with xdotool a bit - it might be capable of doing such a thing.
I'd be happy to field questions for this type of work (probably via this issue thread) if you (or anyone else, for that matter) wants to give this a go.
From Ben's Medium writeup:
I'd like to use
browserd
for streaming existing electron apps, for example postman and dot. These apps would run in a container on a server and be streamed to abrowserd/stream-consumer
. This goal appears to be fundamentally different to the intention of the project which is for streaming a URL accessible web app, not an existing electron app.From your experience on this project, do you know if it's possible to achieve my goal? Essentially
SERVICE_URL
would point to an electron app, however an electron app is not addressable by a URL.