Skip to content

fix(network): KeyError on Chrome 146 due to CDP privateNetworkRequestPolicy rename#250

Open
tabmadi wants to merge 1 commit intocdpdriver:mainfrom
tabmadi:fix/chrome146-local-network-access-rename
Open

fix(network): KeyError on Chrome 146 due to CDP privateNetworkRequestPolicy rename#250
tabmadi wants to merge 1 commit intocdpdriver:mainfrom
tabmadi:fix/chrome146-local-network-access-rename

Conversation

@tabmadi
Copy link
Copy Markdown

@tabmadi tabmadi commented Mar 30, 2026

Description

Chrome 146 renamed the CDP field privateNetworkRequestPolicy to localNetworkAccessRequestPolicy in the Network.requestWillBeSentExtraInfo event's clientSecurityState object. This causes zendriver to throw a KeyError on nearly every network request, flooding logs with tracebacks.

The fix updates ClientSecurityState.from_json in zendriver/cdp/network.py to accept both the old and new key name, maintaining backward compatibility with older Chrome versions.

Fixes #249

Pre-merge Checklist

  • I have described my change in the section above.
  • I have ran the ./scripts/format.sh and ./scripts/lint.sh scripts. My code is properly formatted and has no linting errors.
  • I have ran uv run pytest and ensured all tests pass. (93 passed, 1 pre-existing failure in test_keyinputs.py::test_visible_events[headless1] — unrelated to this change.)
  • I have added my change to CHANGELOG.md under the [Unreleased] section.

@tabmadi tabmadi requested a review from a team as a code owner March 30, 2026 13:17
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.

[Bug] KeyError: 'privateNetworkRequestPolicy' on Chrome 146+

1 participant