Skip to content

fix: move hardcoded config to env vars and replace timeouts with waitForSelector [ GSSOC'26 ]#520

Open
rudra3007-pro wants to merge 1 commit into
UTKARSHH20:mainfrom
rudra3007-pro:fix/screenshot-env-config
Open

fix: move hardcoded config to env vars and replace timeouts with waitForSelector [ GSSOC'26 ]#520
rudra3007-pro wants to merge 1 commit into
UTKARSHH20:mainfrom
rudra3007-pro:fix/screenshot-env-config

Conversation

@rudra3007-pro

Copy link
Copy Markdown

Fixes #519

##Problem
capture.js hardcodes the dev server URL, login credentials, and screenshot output path. setTimeout is used to wait for the sidebar and chat to load, which is fragile on slow machines.

##Changes:
URL, email, password, and output path now read from .env via dotenv with fallbacks
Replaced both setTimeout waits with waitForSelector so the script reacts to actual DOM readiness
Wrapped browser.close() in a finally block so the browser always closes even if the script throws
Auto-creates the output directory if it doesn't exist
Throws a clear error if login appears to fail (sidebar never appears after submit)

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@rudra3007-pro, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 53 minutes and 50 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4e242167-e073-4bca-a32b-25a23ae5c0ab

📥 Commits

Reviewing files that changed from the base of the PR and between 62b4998 and b555a23.

📒 Files selected for processing (1)
  • backend/capture.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@rudra3007-pro

Copy link
Copy Markdown
Author

@UTKARSHH20 Please review this PR

1 similar comment
@rudra3007-pro

Copy link
Copy Markdown
Author

@UTKARSHH20 Please review this PR

@rudra3007-pro

Copy link
Copy Markdown
Author

@UTKARSHH20 Please review this PR

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.

capture.js hardcodes selectors and paths, breaking on any UI or config change [ GSSOC'26 ]

1 participant