-
Notifications
You must be signed in to change notification settings - Fork 366
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
GOOGLE_CHROME_SHIM now responds to --version and --product-version. #73
GOOGLE_CHROME_SHIM now responds to --version and --product-version. #73
Conversation
@kapoorlakshya That's great - hopefully it's accepted -- I do wonder why chrome on linux has |
I agree. I'll go ahead and add another condition to have it respond to |
$ google-chrome-stable --version
Google Chrome 74.0.3729.108
$ google-chrome-stable --product-version
74.0.3729.108 |
Hi @joshwlewis and @jabrown85, is there any chance of this getting reviewed/merged? |
Can confirm this fix works great in production, thanks 🙏 |
I deployed this to the buildpack registry and it's in master for those not using the shorthand buildpack name |
@jabrown85 Thank you very much! |
@@ -171,7 +171,13 @@ BIN_DIR=$BUILD_DIR/.apt/usr/bin | |||
rm $BIN_DIR/$SHIM | |||
cat <<EOF >$BIN_DIR/$SHIM | |||
#!/usr/bin/env bash | |||
exec \$HOME/.apt/opt/google/$BIN --headless --no-sandbox --disable-gpu --remote-debugging-port=9222 \$@ | |||
if [ $1 = "--version" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the $ in $1
be escaped ?
When using the heroku/google-chrome buildpack and running heroku ci:debug
, I get
~ $ cat $GOOGLE_CHROME_SHIM
#!/usr/bin/env bash
if [ /app = "--version" ]; then
exec $HOME/.apt/opt/google/chrome/chrome --version
elif [ /app = "--product-version" ]; then
exec $HOME/.apt/opt/google/chrome/chrome --product-version
else
exec $HOME/.apt/opt/google/chrome/chrome --headless --no-sandbox --disable-gpu --remote-debugging-port=9222 $@
fi
~ $
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is correct, I'm seeing this:
if [ /tmp/build_9b8b699572a1f61d9096ed0e275f2c41 = "--version" ]; then
because the $1
isn't escaped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #74
Thanks for fixing it, but just curious why you would call Sorry, not a Heroku user. |
@kapoorlakshya I called |
@isc Can you please share what's not working? I would appreciate a bug report on the |
@kapoorlakshya it is fixed in #74 @isc was just doing the This has been merged to master and pushed to our buildpack registry. |
This change adds out-of-the-box compatibility with the
webdrivers
gem, which apparently quite a few Heroku users are using. Currently, the users have to use a workaround in their project to get the Chrome version from$GOOGLE_CHROME_BIN
, so thatwebdrivers
can download the appropriate version ofchromedriver
, and then switch back to$GOOGLE_CHROME_SHIM
to launch Chrome.See titusfortner/webdrivers#40, titusfortner/webdrivers#72, and titusfortner/webdrivers#134.
This simple change will provide the convenience of not needing any hacks to make the two work :).