Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Create UnkownEvent and UnkownObject classes for unkown CDP events #24

Merged
HMaker merged 2 commits intoHMaker:masterHMaker/python-cdp:masterfrom
RazorBest:add-unknown-eventsRazorBest/python-cdp:add-unknown-eventsCopy head branch name to clipboard
Oct 3, 2025
Merged

Create UnkownEvent and UnkownObject classes for unkown CDP events #24
HMaker merged 2 commits intoHMaker:masterHMaker/python-cdp:masterfrom
RazorBest:add-unknown-eventsRazorBest/python-cdp:add-unknown-eventsCopy head branch name to clipboard

Conversation

@RazorBest
Copy link
Contributor

CDP updates periodically, and sometimes, new events are added. Python-cdp throws an error for these kind of events, because there isn't a corresponding class for them. This, of course, can be solved by updating the repository with the new CDP specification.

However, this makes tools that might have python-cdp as a dependency, unusable, after a while. Especially when these events are generated frequently. However, those tools probably don't need the newly added events. They might still be functional.

This PR makes python-cdp treat the case where a CDP event is unkown. It creates a generic class called UnkownEvent that can be used like any other event class. It can contain instances of UnkownObject, depending on the structure of the json.

Additionally, tools that use python-cdp can read the new events by working with instances of UnknownEvent.

After this, python-cdp can potentially continue to work for newer versions of cdp, without syncing the repo with the spec. This, however, doesn't solve the case where existing CDP events or objects are updated.

@HMaker HMaker merged commit 28eb949 into HMaker:master Oct 3, 2025
@HMaker
Copy link
Owner

HMaker commented Oct 3, 2025

Thanks, it's really usefull to avoid breaking CDP clients due missing event types.

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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.