Skip to content

[Bug]: A frame with an empty url will dead-loop #9675

@Konano

Description

@Konano

Playwright version

1.15.2-1633455481000

Operating system

Linux

What browsers are you seeing the problem on?

Chromium

Other information

No response

What happened? / Describe the bug

A frame with an empty url will dead-loop.

Code snippet to reproduce your bug

from playwright.sync_api import sync_playwright

def run(playwright):
    chromium = playwright.chromium # or "firefox" or "webkit".
    browser = chromium.launch()
    page = browser.new_page()
    page.goto("file:///var/www/html/index.html")
    for x in page.frames:
        print(x.url)
        print(x.content())
    browser.close()

with sync_playwright() as playwright:
    run(playwright)

/var/www/html/index.html:

<iframe src="javascript:false" title="" frameborder="0" tabindex="-1" style="position: absolute; width: 0px; height: 0px; border: 0px;"></iframe>

Relevant log output

Traceback (most recent call last):
  File "test.py", line 15, in <module>
  File "test.py", line 10, in run
    print(x.content())
  File "/home/nano/.local/lib/python3.8/site-packages/playwright/sync_api/_generated.py", line 3797, in content
    self._sync("frame.content", self._impl_obj.content())
  File "/home/nano/.local/lib/python3.8/site-packages/playwright/_impl/_sync_base.py", line 109, in _sync
    self._dispatcher_fiber.switch()
  File "/home/nano/.local/lib/python3.8/site-packages/playwright/sync_api/_context_manager.py", line 48, in greenlet_main
    loop.run_until_complete(self._connection.run_as_sync())
  File "/usr/lib/python3.8/asyncio/base_events.py", line 603, in run_until_complete
    self.run_forever()
  File "/usr/lib/python3.8/asyncio/base_events.py", line 570, in run_forever
    self._run_once()
  File "/usr/lib/python3.8/asyncio/base_events.py", line 1823, in _run_once
    event_list = self._selector.select(timeout)
  File "/usr/lib/python3.8/selectors.py", line 468, in select
    fd_event_list = self._selector.poll(timeout, max_ev)
KeyboardInterrupt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions