Skip to content

fix(playwright): fractional clicks, geolocation accuracy, stale frames, wire headers and console handles - #464

Merged
thalissonvs merged 1 commit into
mainfrom
fix/playwright-compat-gaps
Sep 29, 2026
Merged

thalissonvs merged 1 commit into
mainfrom
fix/playwright-compat-gaps

Conversation

@thalissonvs

@thalissonvs thalissonvs commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Running a long script assembled from public Playwright examples on pydoll.playwright surfaced five gaps against Playwright 1.63:

  • Mouse coordinates were rounded to whole pixels, so a 1x1 target at a fractional offset (TodoMVC's toggle-all checkbox) was missed by check().
  • Emulation.setGeolocationOverride without an accuracy makes Chrome answer POSITION_UNAVAILABLE; the context option and set_geolocation() now default it to 0 like Playwright.
  • Chrome does not announce the child frames of a document that a navigation replaced, so page.frames kept listing iframes from the previous page; a frame navigation now detaches its known descendants.
  • requestWillBeSentExtraInfo and responseReceivedExtraInfo were ignored, so all_headers(), header_value(), header_values() and headers_array() missed cookie and set-cookie; headers stays provisional like Playwright.
  • Console arguments passed by value used a private stand-in the sync facade never wrapped, so args[0].json_value() returned a coroutine; they now come from the frame's handle factory, and ConsoleMessage.text previews plain objects and arrays instead of printing Object.

Each fix carries an integration test.

Summary by CodeRabbit

  • Bug Fixes
    • Mouse interactions now preserve fractional coordinates for more precise targeting.
    • Geolocation overrides work when accuracy is omitted, while honoring an explicitly supplied accuracy.
    • Console messages display object and array previews more reliably.
    • Network header accessors include browser-added headers and correctly separate multiple values.
    • Frame lists now reflect child frames being detached during navigation and updated when new frames load.

…s, wire headers and console handles

Running a long script assembled from public Playwright examples on
pydoll.playwright surfaced five gaps against Playwright 1.63:

- Mouse coordinates were rounded to whole pixels, so a 1x1 target at a
  fractional offset (TodoMVC's toggle-all checkbox) was missed by check().
- Emulation.setGeolocationOverride without an accuracy makes Chrome answer
  POSITION_UNAVAILABLE; the context option and set_geolocation() now
  default it to 0 like Playwright.
- Chrome does not announce the child frames of a document that a
  navigation replaced, so page.frames kept listing iframes from the
  previous page; a frame navigation now detaches its known descendants.
- requestWillBeSentExtraInfo and responseReceivedExtraInfo were ignored,
  so all_headers(), header_value(), header_values() and headers_array()
  missed cookie and set-cookie; headers stays provisional like Playwright.
- Console arguments passed by value used a private stand-in the sync
  facade never wrapped, so args[0].json_value() returned a coroutine; they
  now come from the frame's handle factory, and ConsoleMessage.text
  previews plain objects and arrays instead of printing Object.

Each fix carries an integration test.
@coderabbitai

coderabbitai Bot commented Sep 29, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 9c2d7cfe-d10b-4fa9-b425-152201465b9f

📥 Commits

Reviewing files that changed from the base of the PR and between 692101c and deba286.

📒 Files selected for processing (12)
  • pydoll/commands/input_commands.py
  • pydoll/playwright/_actions.py
  • pydoll/playwright/_browser_context.py
  • pydoll/playwright/_dialog.py
  • pydoll/playwright/_navigation.py
  • pydoll/playwright/_network.py
  • pydoll/playwright/_page.py
  • pydoll/playwright/sync_api/_generated.py
  • tests/integration/playwright/test_events_integration.py
  • tests/integration/playwright/test_locator_integration.py
  • tests/integration/playwright/test_page_integration.py
  • tests/integration/sync/test_sync_api_integration.py
 ___________________________________________________________________
< Your feature is behind a flag. Your bug is already in production. >
 -------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.91667% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pydoll/playwright/_network.py 96.55% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@thalissonvs
thalissonvs merged commit f8b847b into main Sep 29, 2026
23 of 26 checks passed
@thalissonvs
thalissonvs deleted the fix/playwright-compat-gaps branch September 29, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant