Skip to content

[OPTIMISATION] fetch platform specific chrome image#12

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

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

Conversation

@realityzero

Copy link
Copy Markdown

code works w/ different environments now

@vercel

vercel Bot commented Mar 4, 2024

Copy link
Copy Markdown

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

@vikiival first needs to authorize it.

@vercel

vercel Bot commented Mar 13, 2024

Copy link
Copy Markdown

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?

@vikiival vikiival left a comment

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.

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