Headless Browser
interface HeadlessBrowser
A browser running inside this app: no server, no cable, no visible UI.
Create one per host app and keep it for as long as automation is wanted. Creating it does not start a WebView; newPage does.
val browser = HeadlessBrowser.create(context, BrowserConfig())
val page = browser.newPage() // 1x1, text and DOM only
page.goto("https://example.com", WaitUntil.DomStable())
val title = page.title()
page.close()
browser.close()Content copied to clipboard
Long-running automation belongs in a foreground service the host app owns. A WebView working in a backgrounded app can be throttled or killed, and this library does not take that decision on the app's behalf.
Types
Link copied to clipboard
object Companion
Where a HeadlessBrowser instance comes from; there is no public constructor.