| 3548 | |
| 3549 | class Chrome(CDPMethods): |
| 3550 | def __init__(self, url=None, **kwargs): |
| 3551 | if not url: |
| 3552 | url = "about:blank" |
| 3553 | loop = asyncio.new_event_loop() |
| 3554 | kwargs["loop"] = loop |
| 3555 | driver = cdp_util.start_sync(**kwargs) |
| 3556 | page = loop.run_until_complete(driver.get(url)) |
| 3557 | wait_timeout = 30.0 |
| 3558 | if hasattr(sb_config, "_cdp_proxy") and sb_config._cdp_proxy: |
| 3559 | wait_timeout = 45.0 |
| 3560 | try: |
| 3561 | loop.run_until_complete( |
| 3562 | asyncio.wait_for(page.wait(), timeout=wait_timeout) |
| 3563 | ) |
| 3564 | except asyncio.TimeoutError: |
| 3565 | pass |
| 3566 | except Exception: |
| 3567 | pass |
| 3568 | super().__init__(loop, page, driver) |