Headless / console / worker ability to mimic HTML viewer with javascript

I have a couple of desktop projects where I use a window with a HTMLViewer to request a web page, then inject javascript to read out the “inner HTML” after the page populates. And execute javascript to mimic user actions such as inserting text, selecting dropdowns, click buttons, etc.

I’d like to be able to do that from workers or console apps instead of windows in a desktop app – essentially just collect this data in the background and use multiple cores to do it. In other words, similar to what you can do with some scriptable headless web scrape tools.

Is there any way to do that with Xojo? MBS? Note that I do NOT want to just read the URL contents via URLConnection or whatever. I need the page to act like it is in a webview and run its own javascript etc so it can populate page contents that is not part of the page source HTML.

Everything I have found so far in Xojo needs me to use a desktop app with a Window containing a HTMLViewer control.

A while ago I did some research into this topic. My app loads html into a html viewer and prints that into pdf.

For html you need UI and UI needs a desktop app. No console or worker.

There is something called “headless Chrome”. But Chrome is not something that I want to ship with my app.

This would not be shipped to users, so I am OK with solutions that need non-standard components. A quick search on “headless Chrome” looks like it may at least give me a rabbit hole to follow to see how easy that will be to manipulate from Xojo…