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

Function get_playwright_headless

client.py:75–88  ·  view source on GitHub ↗

Get the Playwright headless mode setting. Reads from PLAYWRIGHT_HEADLESS environment variable, defaults to True. Returns True for headless mode (invisible browser), False for visible browser.

()

Source from the content-addressed store, hash-verified

73
74
75def get_playwright_headless() -> bool:
76 """
77 Get the Playwright headless mode setting.
78
79 Reads from PLAYWRIGHT_HEADLESS environment variable, defaults to True.
80 Returns True for headless mode (invisible browser), False for visible browser.
81 """
82 value = os.getenv("PLAYWRIGHT_HEADLESS", str(DEFAULT_PLAYWRIGHT_HEADLESS).lower()).strip().lower()
83 truthy = {"true", "1", "yes", "on"}
84 falsy = {"false", "0", "no", "off"}
85 if value not in truthy | falsy:
86 print(f" - Warning: Invalid PLAYWRIGHT_HEADLESS='{value}', defaulting to {DEFAULT_PLAYWRIGHT_HEADLESS}")
87 return DEFAULT_PLAYWRIGHT_HEADLESS
88 return value in truthy
89
90
91# Valid browsers supported by Playwright MCP

Callers 1

create_clientFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected