Skip to content

[OPTIMISATION] fetch platform specific chrome image#12

Open
realityzero wants to merge 1 commit intovikiival:mainfrom
realityzero:fix-chrome-platform
Open

[OPTIMISATION] fetch platform specific chrome image#12
realityzero wants to merge 1 commit intovikiival:mainfrom
realityzero:fix-chrome-platform

Conversation

@realityzero
Copy link
Copy Markdown

code works w/ different environments now

@vercel
Copy link
Copy Markdown

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.

@vercel
Copy link
Copy Markdown

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
Copy Markdown
Owner

Hey thanks for the PR!

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

@realityzero
Copy link
Copy Markdown
Author

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

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

Comment thread api/screenshot.ts
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 thread api/screenshot.ts
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
Copy Markdown
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