in src/nova_act/impl/playwright.py [0:0]
def _launch_browser(self, context_options):
"""Launches a Playwright Chromium based browser with Chromium as fallback."""
if (channel := context_options.get("channel")) != "chromium":
try:
context = self._playwright.chromium.launch_persistent_context(
self._user_data_dir, **context_options # type: ignore[arg-type]
)
return context
except PlaywrightError:
_LOGGER.warning(
f"The Nova Act SDK is unable to run with `chrome_channel='{channel}'` and is "
"falling back to 'chromium'. If you wish to use an alternate `chrome_channel`, "
f"please install it with `python -m playwright install {channel}`. For more information, "
"please consult Playwright's documentation: https://playwright.dev/python/docs/browsers."
)
context_options["channel"] = "chromium"
context = self._playwright.chromium.launch_persistent_context(
self._user_data_dir,
**context_options, # type: ignore[arg-type]
)
return context