Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR integrates the @sparticuz/chromium package to replace the default Playwright Chromium browser configuration, likely for better compatibility with serverless environments like AWS Lambda.
- Replaces direct Playwright chromium usage with @sparticuz/chromium for browser execution
- Simplifies browser context configuration by removing custom user agent and headless settings
- Adds @sparticuz/chromium as a new dependency
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/src/main.ts | Updates browser launch configuration to use @sparticuz/chromium executable and args |
| scripts/package.json | Adds @sparticuz/chromium dependency |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| "ts-node": "^10.9.0", | ||
| "typescript": "^5.0.0" | ||
| "typescript": "^5.0.0", | ||
| "@sparticuz/chromium": "^141.0.0" |
There was a problem hiding this comment.
The @sparticuz/chromium dependency should be moved to the 'dependencies' section instead of 'devDependencies' since it's used in production code for browser execution.
| args: ["--disable-gpu", "--disable-blink-features=AutomationControlled"], | ||
| browser = await playwright.launch({ | ||
| args: chromium.args, | ||
| executablePath: await chromium.executablePath(), |
There was a problem hiding this comment.
Consider adding the 'headless: true' option back to the launch configuration for consistency and to ensure the browser runs in headless mode, especially in serverless environments.
| executablePath: await chromium.executablePath(), | |
| executablePath: await chromium.executablePath(), | |
| headless: true, |
No description provided.