(msg: ConsoleMessage)
| 169 | audio_logs: list[str] = [] |
| 170 | |
| 171 | def console_log_handler(msg: ConsoleMessage) -> None: |
| 172 | text = msg.text |
| 173 | if msg.type in ("error", "warn"): |
| 174 | browser_errors.append(f"[{msg.type}] {text}") |
| 175 | # Capture audio-related logs for verification |
| 176 | if "Auto-loading audio from URL" in text: |
| 177 | audio_logs.append(text) |
| 178 | if "Audio auto-load from URL complete" in text: |
| 179 | audio_logs.append(text) |
| 180 | |
| 181 | page.on("console", console_log_handler) |
| 182 |