Skip to content

fix: use chromium in layer#51

Merged
Perry2004 merged 1 commit intomainfrom
fix/use-layer-chromium-path
Oct 13, 2025
Merged

fix: use chromium in layer#51
Perry2004 merged 1 commit intomainfrom
fix/use-layer-chromium-path

Conversation

@Perry2004
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings October 13, 2025 18:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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"
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

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

The @sparticuz/chromium dependency should be moved to the 'dependencies' section instead of 'devDependencies' since it's used in production code for browser execution.

Copilot uses AI. Check for mistakes.
args: ["--disable-gpu", "--disable-blink-features=AutomationControlled"],
browser = await playwright.launch({
args: chromium.args,
executablePath: await chromium.executablePath(),
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
executablePath: await chromium.executablePath(),
executablePath: await chromium.executablePath(),
headless: true,

Copilot uses AI. Check for mistakes.
@Perry2004 Perry2004 merged commit 92708fd into main Oct 13, 2025
2 checks passed
@Perry2004 Perry2004 deleted the fix/use-layer-chromium-path branch October 13, 2025 18:40
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