Skip to content

Conversation

@reformedot
Copy link
Collaborator

@reformedot reformedot commented Aug 25, 2025

Added browser-use custom CDP domain + option to define CDP version + updated specification


Summary by cubic

Adds a custom BrowserUse CDP domain with captcha solver events and lets you pin the CDP spec version used by the generator. Also syncs to the latest CDP APIs and adds a Taskfile for common dev tasks.

  • New Features

    • New BrowserUse domain with events: captchaSolverStarted, captchaSolverFinished, and ActiveTargetChanged (client, types, registration, and schema included).
    • Pin protocol version via CDP_VERSION in generator/constants.py; generator now includes any JSON in cdp_use/custom_protocols/.
    • Upstream CDP updates exposed:
      • CSS: getEnvironmentVariables; computed style extra fields.
      • DOM: forceShowPopover; container queries support for anchored().
      • Emulation: screen management (getScreenInfos, addScreen, removeScreen).
      • Network, Media, Page: new fields/events and clarifications.
    • Taskfile with tasks: generate, build, install, lint, format, format-json, example, clean.
  • Migration

    • To pin CDP, set CDP_VERSION in cdp_use/generator/constants.py and re-run the generator.
    • Add custom protocol files under cdp_use/custom_protocols/ and re-run the generator to include them.
    • For BrowserUse events: register handlers via Registration.BrowserUse.* and emit with client.emit_event("BrowserUse.captchaSolverStarted", {...}).

Written for commit f99397f. Summary will update automatically on new commits.

@reformedot reformedot requested review from gregpr07 and pirate August 25, 2025 08:57
@reformedot
Copy link
Collaborator Author

Important files to review are in:
cdp_use/cdp/browseruse/* and cdp_use/custom_protocols/browseruse.json

@gregpr07 @pirate

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 41 files

@reformedot
Copy link
Collaborator Author

@cubic-dev-ai review this

@cubic-dev-ai
Copy link

cubic-dev-ai bot commented Nov 26, 2025

@cubic-dev-ai review this

@reformedot I've started the AI code review. It'll take a few minutes to complete.

@reformedot reformedot removed the request for review from pirate November 26, 2025 19:26
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 279 files (reviewed changes from recent commits).

Note: This PR contains a large number of files. cubic only reviews up to 150 files per PR, so some files may not have been reviewed.

Prompt for AI agents (all 1 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="cdp_use/cdp/accessibility/types.py">

<violation number="1" location="cdp_use/cdp/accessibility/types.py:182">
Fix the typo in the AXPropertyName docstring so it reads &quot;node&quot; instead of &quot;noode&quot; to keep the generated documentation accurate.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

- from 'activedescendant' to 'owns' - relationships between elements other than parent/child/sibling."""

- from 'activedescendant' to 'owns': relationships between elements other than parent/child/sibling
- from 'activeFullscreenElement' to 'uninteresting': reasons why this noode is hidden"""
Copy link

@cubic-dev-ai cubic-dev-ai bot Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the typo in the AXPropertyName docstring so it reads "node" instead of "noode" to keep the generated documentation accurate.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At cdp_use/cdp/accessibility/types.py, line 182:

<comment>Fix the typo in the AXPropertyName docstring so it reads &quot;node&quot; instead of &quot;noode&quot; to keep the generated documentation accurate.</comment>

<file context>
@@ -89,15 +113,73 @@ class AXValue(TypedDict):
-- from &#39;activedescendant&#39; to &#39;owns&#39; - relationships between elements other than parent/child/sibling.&quot;&quot;&quot;
-
+- from &#39;activedescendant&#39; to &#39;owns&#39;: relationships between elements other than parent/child/sibling
+- from &#39;activeFullscreenElement&#39; to &#39;uninteresting&#39;: reasons why this noode is hidden&quot;&quot;&quot;
 
 
</file context>
Suggested change
- from 'activeFullscreenElement' to 'uninteresting': reasons why this noode is hidden"""
- from 'activeFullscreenElement' to 'uninteresting': reasons why this node is hidden"""
Fix with Cubic

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 286 files

Note: This PR contains a large number of files. cubic only reviews up to 150 files per PR, so some files may not have been reviewed.

Prompt for AI agents (all 2 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="Taskfile.yml">

<violation number="1" location="Taskfile.yml:33">
format-json fails when no custom protocol files exist because the unmatched glob is treated as a literal path. Add a guard so the loop skips/terminates when no files match.</violation>
</file>

<file name="cdp_use/cdp/accessibility/types.py">

<violation number="1" location="cdp_use/cdp/accessibility/types.py:182">
The new docstring line describing hidden-node reasons contains a typo (“noode” instead of “node”), which should be corrected for clarity.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

desc: "Format JSON protocol files"
cmds:
- |
for file in cdp_use/custom_protocols/*.json; do
Copy link

@cubic-dev-ai cubic-dev-ai bot Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format-json fails when no custom protocol files exist because the unmatched glob is treated as a literal path. Add a guard so the loop skips/terminates when no files match.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Taskfile.yml, line 33:

<comment>format-json fails when no custom protocol files exist because the unmatched glob is treated as a literal path. Add a guard so the loop skips/terminates when no files match.</comment>

<file context>
@@ -0,0 +1,46 @@
+    desc: &quot;Format JSON protocol files&quot;
+    cmds:
+      - |
+        for file in cdp_use/custom_protocols/*.json; do
+          python3 -m json.tool &quot;$file&quot; &quot;$file.tmp&quot; &amp;&amp; mv &quot;$file.tmp&quot; &quot;$file&quot;
+        done
</file context>

✅ Addressed in b3ee5c0

- from 'activedescendant' to 'owns' - relationships between elements other than parent/child/sibling."""

- from 'activedescendant' to 'owns': relationships between elements other than parent/child/sibling
- from 'activeFullscreenElement' to 'uninteresting': reasons why this noode is hidden"""
Copy link

@cubic-dev-ai cubic-dev-ai bot Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new docstring line describing hidden-node reasons contains a typo (“noode” instead of “node”), which should be corrected for clarity.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At cdp_use/cdp/accessibility/types.py, line 182:

<comment>The new docstring line describing hidden-node reasons contains a typo (“noode” instead of “node”), which should be corrected for clarity.</comment>

<file context>
@@ -89,15 +113,73 @@ class AXValue(TypedDict):
-- from &#39;activedescendant&#39; to &#39;owns&#39; - relationships between elements other than parent/child/sibling.&quot;&quot;&quot;
-
+- from &#39;activedescendant&#39; to &#39;owns&#39;: relationships between elements other than parent/child/sibling
+- from &#39;activeFullscreenElement&#39; to &#39;uninteresting&#39;: reasons why this noode is hidden&quot;&quot;&quot;
 
 
</file context>
Suggested change
- from 'activeFullscreenElement' to 'uninteresting': reasons why this noode is hidden"""
- from 'activeFullscreenElement' to 'uninteresting': reasons why this node is hidden"""
Fix with Cubic

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