createBrowser
The entry point for creating a new Browser instance.
This function initializes a new Browser instance with the provided configuration. It sets up the necessary parameters such as user data directory, headless mode, browser executable path, and more. It also handles the creation of a coroutine scope for the browser instance and sets up a shutdown hook to clean up resources when the application exits.
Return
A new instance of the Browser class.
Parameters
The parent CoroutineScope, in which the browser will run.
Optional path to the user data directory. If not provided, a temporary profile will be created.
If true, the browser will run in headless mode. Defaults to false.
Optional user agent string to use for the browser. If not provided, the default user agent will be used.
Optional path to the browser executable. If not provided, the default browser will be used.
Optional list of additional arguments to pass to the browser executable.
If true, the browser will run in a sandboxed environment. Defaults to true.
The language to use for the browser.
Optional host address for the browser connection. If not provided, defaults to "127.0.0.1".
Optional port for the browser connection. If not provided, a free port will be assigned.
The entry point for creating a new Browser instance.
This function initializes a new Browser instance with the provided configuration. It sets up the necessary parameters such as user data directory, headless mode, browser executable path, and more. It also handles the creation of a coroutine scope for the browser instance and sets up a shutdown hook to clean up resources when the application exits.
Return
A new instance of the Browser class.
Parameters
The parent CoroutineScope, in which the browser will run.
Configuration for the browser.