Context:
- Playwright Version: 1.17.2
- Operating System: Windows
- 3.10.1
- Browser: Chromium
Code Snippet
import re
from playwright.sync_api import sync_playwright
from string import ascii_letters
from random import choice
def block(route, request):
route.abort()
with sync_playwright() as p:
browser = playwright.chromium.connect_over_cdp(endpoint_url=ws, timeout=60000, slow_mo=20)
context = browser.contexts[0]
page = context.pages[0] if context.pages else context.new_page()
page.route(re.compile("http(s)?://google.com/.*", block)
page.wait_for_timeout(5000)
Describe the bug
It happens often, around 30% of the times - When calling page.route the function never returns and hangs there forever. Whatever is going wrong - for sure a timeout is missing there that should throw after an amount of time. - Sadly if this happens its also almost impossible to get back control.
EDIT: Meanwhile tested with sync and async version, happens with both.