Skip to content

Commit 6aec1ce

Browse files
authored
Merge pull request #578 from salemove/fix_chrome_beta_support
Fix Chrome beta support for NodeChrome
2 parents 3fb76ba + 3ba850f commit 6aec1ce

File tree

4 files changed

+20
-93
lines changed

4 files changed

+20
-93
lines changed

NodeChrome/Dockerfile.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key
1919
&& rm /etc/apt/sources.list.d/google-chrome.list \
2020
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
2121

22+
#=================================
23+
# Chrome Launch Script Wrapper
24+
#=================================
25+
COPY wrap_chrome_binary /opt/bin/wrap_chrome_binary
26+
RUN /opt/bin/wrap_chrome_binary
27+
2228
USER seluser
2329

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

4147
COPY generate_config /opt/bin/generate_config
4248

43-
#=================================
44-
# Chrome Launch Script Modification
45-
#=================================
46-
COPY chrome_launcher.sh /opt/google/chrome/google-chrome
47-
4849
# Generating a default config during build time
4950
RUN /opt/bin/generate_config > /opt/selenium/config.json

NodeChrome/chrome_launcher.sh

Lines changed: 0 additions & 87 deletions
This file was deleted.

NodeChrome/generate_config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

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

55
cat <<_EOF
66
{

NodeChrome/wrap_chrome_binary

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
WRAPPER_PATH=$(readlink -f /usr/bin/google-chrome)
4+
BASE_PATH="$WRAPPER_PATH-base"
5+
mv "$WRAPPER_PATH" "$BASE_PATH"
6+
7+
cat > "$WRAPPER_PATH" <<_EOF
8+
#!/bin/bash
9+
10+
# Note: exec -a below is a bashism.
11+
exec -a "\$0" "$BASE_PATH" --no-sandbox "\$@"
12+
_EOF
13+
chmod +x "$WRAPPER_PATH"

0 commit comments

Comments
 (0)