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

feat: add ability to use latest stable version of chrome #889

Closed
wants to merge 2 commits into from

Conversation

dylantientcheu
Copy link
Contributor

Update chrome to latest stable version.

This will help skip the playwright's release schedule for chromium and help renderscript use the latest chrome version without waiting for them.

How

  • Downloading chrome in the docker when the build-arg (USE_LATEST_CHROME) is set to true
  • Force playwright to use that version by setting an executablePath to the version provided

Test

  • yarn docker:build the vars are already added to the build command
  • docker run -it --rm algolia/renderscript the browser versions are logged after initialization. It should use latest chrome 131.x.x.x

@dylantientcheu dylantientcheu self-assigned this Nov 18, 2024
@sbellone
Copy link
Collaborator

sbellone commented Nov 20, 2024

Hey can you be more specific on the needs? Did you notice some websites that weren't working with Chromium but worked with Chrome?

This will help skip the playwright's release schedule for chromium and help renderscript use the latest chrome version without waiting for them.

Playwright is released regularly, and Chromium version are always released before Chrome: Currently in Playwright you have v132 while as you say Chrome is at v131

Edit: ok my mistake here, I see that Playwright announce v132 on the README but the tagged and downloaded version is the 131.

@dylantientcheu
Copy link
Contributor Author

1 day ago before they release v1.48.2, Playwright was late on the Chromium upgrade. We needed to use the latest stable version of Chromium, which was available way before the Playwright update.

The issue is not with websites, we wanted to be able to use a version of Chromium that is more recent than what Playwright provided. Luckily they now updated to v131 which we could use, but in the future, if we still need to have the latest version before they release, we'd need to do this.

Comment on lines +60 to +62
if (process.env.USE_LATEST_CHROME) {
executablePath =
this.#engine === 'chromium' ? '/usr/bin/google-chrome' : undefined;
Copy link
Collaborator

@sbellone sbellone Nov 20, 2024

Choose a reason for hiding this comment

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

We discussed about the reasons offline, it now makes sense. My only problem is that now that it's built systematically with USE_LATEST_CHROME, so if you run it without the argument, it will try to use Chromium, which is not downloaded, so it will no work.

Edit: actually it would work as ENV USE_LATEST_CHROME="true" is hardcoded, but ideally we want to configure the USE_LATEST_CHROME at build time

@dylantientcheu
Copy link
Contributor Author

Closing in favor of #890
This will help a simpler resolution and no introduction of breaking change.

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.

4 participants