Skip to content

Conversation

@LawyZheng
Copy link
Collaborator

@LawyZheng LawyZheng commented Oct 20, 2025

Important

Adds documentation for connecting a browser session using playwright-python in introduction.mdx.

  • Documentation:
    • Adds a new section "Connect A Browser Session" in introduction.mdx.
    • Provides a code example using playwright-python to connect to a browser session and set download behavior via CDP.

This description was created by Ellipsis for ed9e0fc. You can customize this summary. It will automatically update as commits are pushed.

Summary by CodeRabbit

  • Documentation
    • Added a new guide showing how to connect to an existing browser session using Playwright (Python), with a sample demonstrating CDP-based connection, enabling download behavior, and navigating to a page.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 20, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds a new "Connect A Browser Session" subsection to the browser sessions introduction with a Python Playwright example that connects to an existing browser via CDP, enables download behavior, and navigates to a page.

Changes

Cohort / File(s) Summary
Documentation: Browser session CDP example
fern/browser-sessions/introduction.mdx
Adds "Connect A Browser Session" subsection featuring a Python sync_playwright snippet that connects to a running browser using browser_address (CDP URL), creates a CDP session to set download permissions, obtains the first context/page, and navigates to a URL.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer script
    participant Playwright as Playwright Client
    participant Browser as Remote Browser (CDP)
    participant Page as Page / Context

    Dev->>Playwright: sync_playwright() -> connect_over_cdp(browser_address)
    Playwright->>Browser: Establish CDP connection
    Note right of Browser#lightblue: New CDP session created\n(setDownloadBehavior)
    Playwright->>Browser: new_cdp_session() / send("Page.setDownloadBehavior", ...)
    Browser-->>Playwright: ack
    Playwright->>Browser: get_browser_contexts() -> context[0]
    Playwright->>Page: context[0].pages[0] -> navigate(url)
    Page-->>Dev: page loaded / navigation result
Loading

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested labels

LawyZheng

Poem

🐰 I hopped through docs with nimble feet,
Found a CDP path that's swift and neat,
Playwright joins a browser bright,
Downloads set and pages light,
Hooray—connections snug and sweet! 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "update browser session docs" directly and clearly relates to the main change in the pull request. The changeset adds a new "Connect A Browser Session" subsection with a Playwright code example to the browser-sessions/introduction.mdx file, which is precisely what the title conveys. The title is concise (4 words), avoids vague terminology, and is specific enough that a teammate scanning the commit history would immediately understand this is a documentation update for browser session functionality.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch lawy/update-browser-session-docs

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 and usage tips.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to ed9e0fc in 1 minute and 25 seconds. Click for details.
  • Reviewed 39 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. fern/browser-sessions/introduction.mdx:47
  • Draft comment:
    Typographical error: The variable name 'browser_adress' is misspelled. It should be 'browser_address' to match the property and for consistency.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_mhCphASGK3JsIQzI

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed ed9e0fc in 1 minute and 41 seconds. Click for details.
  • Reviewed 39 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. fern/browser-sessions/introduction.mdx:66
  • Draft comment:
    Indentation inconsistency: 'page.goto' is indented differently than the rest of the block. Ensure consistent indentation (spaces or tabs) for clarity.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% While the comment is technically correct about the inconsistency, this is a documentation/example file (.mdx), not production code. The indentation inconsistency doesn't affect the readability of the example significantly. The comment feels overly pedantic for documentation. The inconsistent indentation could confuse readers trying to copy-paste the example. Bad formatting in documentation can propagate to user code. While true, the example will still work regardless of indentation style, and most IDEs will auto-format pasted code anyway. This isn't a critical issue worth flagging. The comment should be removed as it's too minor of an issue for documentation examples and doesn't impact functionality.
2. fern/browser-sessions/introduction.mdx:47
  • Draft comment:
    Typo: The variable 'browser_adress' is misspelled; it should be 'browser_address' to match its usage in line 51.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_6F12lzH0QMjcyB7f

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
fern/browser-sessions/introduction.mdx (1)

50-50: Minor formatting issues in code example.

  • Line 50: Trailing # comment marker with no text.
  • Line 66: Appears to have inconsistent indentation (likely tab vs. spaces).

Align these formatting issues with the rest of the example for clarity.

Apply this diff to clean up formatting:

-with sync_playwright() as playwright: # 
+with sync_playwright() as playwright:

And ensure line 66 uses consistent indentation (spaces, not tabs):

     context = browser.contexts[0]
     page = context.pages[0]
 
-	page.goto("https://www.skyvern.com")
+    page.goto("https://www.skyvern.com")

Also applies to: 66-66

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a111893 and ed9e0fc.

📒 Files selected for processing (1)
  • fern/browser-sessions/introduction.mdx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Run tests and pre-commit hooks

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
fern/browser-sessions/introduction.mdx (1)

50-50: Remove the trailing empty comment.

Line 50 contains a trailing comment marker with no content (# ). Remove it for cleaner code.

-with sync_playwright() as playwright: # 
+with sync_playwright() as playwright:
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed9e0fc and 91d2433.

📒 Files selected for processing (1)
  • fern/browser-sessions/introduction.mdx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Run tests and pre-commit hooks
🔇 Additional comments (1)
fern/browser-sessions/introduction.mdx (1)

41-66: Excellent! Previous critical issue is fixed—approve the changes.

The variable naming mismatch from previous reviews (browser_adress vs browser_address) has been corrected. The code example is now syntactically sound and the variables are used consistently.

)
```

## Connect A Browser Session
Copy link
Contributor

Choose a reason for hiding this comment

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

we already have a "Create a Browser Session" section at line 14

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

what do you mean? It's Connect

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.

3 participants