Skip to content

Commit

Permalink
Merge pull request #578 from salemove/fix_chrome_beta_support
Browse files Browse the repository at this point in the history
Fix Chrome beta support for NodeChrome
  • Loading branch information
diemol authored Oct 5, 2017
2 parents 3fb76ba + 3ba850f commit 6aec1ce
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 93 deletions.
11 changes: 6 additions & 5 deletions NodeChrome/Dockerfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key
&& rm /etc/apt/sources.list.d/google-chrome.list \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

#=================================
# Chrome Launch Script Wrapper
#=================================
COPY wrap_chrome_binary /opt/bin/wrap_chrome_binary
RUN /opt/bin/wrap_chrome_binary

USER seluser

#============================================
Expand All @@ -40,10 +46,5 @@ RUN CD_VERSION=$(if [ ${CHROME_DRIVER_VERSION:-latest} = "latest" ]; then echo $

COPY generate_config /opt/bin/generate_config

#=================================
# Chrome Launch Script Modification
#=================================
COPY chrome_launcher.sh /opt/google/chrome/google-chrome

# Generating a default config during build time
RUN /opt/bin/generate_config > /opt/selenium/config.json
87 changes: 0 additions & 87 deletions NodeChrome/chrome_launcher.sh

This file was deleted.

2 changes: 1 addition & 1 deletion NodeChrome/generate_config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

CHROME_VERSION=$(/opt/google/chrome/chrome -version | awk '{ print $3 }')
CHROME_VERSION=$(/usr/bin/google-chrome -version | awk '{ print $3 }')

cat <<_EOF
{
Expand Down
13 changes: 13 additions & 0 deletions NodeChrome/wrap_chrome_binary
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

WRAPPER_PATH=$(readlink -f /usr/bin/google-chrome)
BASE_PATH="$WRAPPER_PATH-base"
mv "$WRAPPER_PATH" "$BASE_PATH"

cat > "$WRAPPER_PATH" <<_EOF
#!/bin/bash
# Note: exec -a below is a bashism.
exec -a "\$0" "$BASE_PATH" --no-sandbox "\$@"
_EOF
chmod +x "$WRAPPER_PATH"

0 comments on commit 6aec1ce

Please sign in to comment.