Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OPTIMISATION] fetch platform specific chrome image #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

realityzero
Copy link

code works w/ different environments now

Copy link

vercel bot commented Mar 4, 2024

Someone is attempting to deploy a commit to a Personal Account owned by @vikiival on Vercel.

@vikiival first needs to authorize it.

Copy link

vercel bot commented Mar 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vercelgl ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 13, 2024 10:16am

@vikiival
Copy link
Owner

Hey thanks for the PR!

I am currently away from Github, will get back to this PR next week

@realityzero
Copy link
Author

Hey @vikiival ! Were you able to take a look at this?

Copy link
Owner

@vikiival vikiival left a comment

Choose a reason for hiding this comment

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

Looks okish, just small things

args: [...chrome.args, '--hide-scrollbars', '--disable-web-security'],
defaultViewport: chrome.defaultViewport,
executablePath: await chrome.executablePath(
`https://github.com/Sparticuz/chromium/releases/download/v116.0.0/chromium-v116.0.0-pack.tar`
Copy link
Owner

Choose a reason for hiding this comment

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

prob path should be optional?

Copy link
Author

Choose a reason for hiding this comment

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

There are 3 ways to do this:

  1. Keep a chromium tar file in code and supply that as an executable. Caveat: increases bundle size.
  2. Store the chromium tar in personal S3 bucket or something similar.
  3. Use github tar file

Either ways we need to provide an executable in Cloud Environment.

Copy link
Owner

Choose a reason for hiding this comment

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

This was an original code that worked on Vercel

executablePath: await chrome.executablePath(),

Comment on lines +42 to +46
process.platform === "win32"
? "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"
: process.platform === "linux"
? "/usr/bin/google-chrome"
: "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome";
Copy link
Owner

Choose a reason for hiding this comment

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

not a fan of double ternary ;D

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