MCPcopy Index your code
hub / github.com/AutoForgeAI/autoforge / get_playwright_browser

Function get_playwright_browser

client.py:95–109  ·  view source on GitHub ↗

Get the browser to use for Playwright. Reads from PLAYWRIGHT_BROWSER environment variable, defaults to firefox. Options: chrome, firefox, webkit, msedge Firefox is recommended for lower CPU usage.

()

Source from the content-addressed store, hash-verified

93
94
95def get_playwright_browser() -> str:
96 """
97 Get the browser to use for Playwright.
98
99 Reads from PLAYWRIGHT_BROWSER environment variable, defaults to firefox.
100 Options: chrome, firefox, webkit, msedge
101 Firefox is recommended for lower CPU usage.
102 """
103 value = os.getenv("PLAYWRIGHT_BROWSER", DEFAULT_PLAYWRIGHT_BROWSER).strip().lower()
104 if value not in VALID_PLAYWRIGHT_BROWSERS:
105 print(f" - Warning: Invalid PLAYWRIGHT_BROWSER='{value}', "
106 f"valid options: {', '.join(sorted(VALID_PLAYWRIGHT_BROWSERS))}. "
107 f"Defaulting to {DEFAULT_PLAYWRIGHT_BROWSER}")
108 return DEFAULT_PLAYWRIGHT_BROWSER
109 return value
110
111
112def get_extra_read_paths() -> list[Path]:

Callers 1

create_clientFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected