Spaces:
Runtime error
Runtime error
akashyadav758 Claude Opus 4.8 (1M context) commited on
Commit Β·
8bb42ac
1
Parent(s): 4216716
Use Chrome for Testing so --load-extension works again
Browse filesBranded google-chrome-stable (Chrome 145) silently ignores --load-extension
since the 2025 Chrome RFC removed it from branded builds, so all 3 unpacked
extensions failed to load (empty chrome://extensions list, no error in log).
Install Chrome for Testing 145.0.7632.117 (unbranded, same version line where
--load-extension still works) and launch it instead of google-chrome-stable.
Everything else (monitor-server, socat CDP proxy on 9222, navigate.py, flags)
is unchanged. Verified locally: all 3 extension service workers register.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- .gitignore +3 -0
- Dockerfile +13 -2
- start_hf.sh +2 -2
.gitignore
CHANGED
|
@@ -1,2 +1,5 @@
|
|
| 1 |
# Hugging Face secret token β never commit
|
| 2 |
hf-token
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Hugging Face secret token β never commit
|
| 2 |
hf-token
|
| 3 |
+
|
| 4 |
+
# Pasted screenshots / scratch images
|
| 5 |
+
image.png
|
Dockerfile
CHANGED
|
@@ -7,10 +7,21 @@ COPY chatgpt-free-api/gpt-extension /opt/gpt-extension
|
|
| 7 |
COPY free-gemini-api/gemini-extension /opt/gemini-extension
|
| 8 |
COPY flow-agent/Flow-extension /opt/flow-extension
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
# Set correct permissions and ownership
|
| 11 |
RUN rm -rf /opt/flow-extension/_metadata && \
|
| 12 |
-
chown -R 1000:1000 /opt/gpt-extension /opt/gemini-extension /opt/flow-extension && \
|
| 13 |
-
chmod -R 755 /opt/gpt-extension /opt/gemini-extension /opt/flow-extension
|
| 14 |
|
| 15 |
# Replace the start script with the non-root version
|
| 16 |
COPY --chmod=755 start_hf.sh /start.sh
|
|
|
|
| 7 |
COPY free-gemini-api/gemini-extension /opt/gemini-extension
|
| 8 |
COPY flow-agent/Flow-extension /opt/flow-extension
|
| 9 |
|
| 10 |
+
# Install Chrome for Testing (unbranded). Branded google-chrome-stable (>=128)
|
| 11 |
+
# silently ignores --load-extension, so unpacked extensions never load. CfT is the
|
| 12 |
+
# unbranded build of the same Chrome version where --load-extension still works.
|
| 13 |
+
ARG CFT_URL=https://storage.googleapis.com/chrome-for-testing-public/145.0.7632.117/linux64/chrome-linux64.zip
|
| 14 |
+
RUN apt-get update && apt-get install -y --no-install-recommends unzip && \
|
| 15 |
+
curl -fsSL "$CFT_URL" -o /tmp/cft.zip && \
|
| 16 |
+
unzip -q /tmp/cft.zip -d /opt && \
|
| 17 |
+
rm -f /tmp/cft.zip && \
|
| 18 |
+
apt-get purge -y unzip && apt-get autoremove -y && \
|
| 19 |
+
apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 20 |
+
|
| 21 |
# Set correct permissions and ownership
|
| 22 |
RUN rm -rf /opt/flow-extension/_metadata && \
|
| 23 |
+
chown -R 1000:1000 /opt/gpt-extension /opt/gemini-extension /opt/flow-extension /opt/chrome-linux64 && \
|
| 24 |
+
chmod -R 755 /opt/gpt-extension /opt/gemini-extension /opt/flow-extension /opt/chrome-linux64
|
| 25 |
|
| 26 |
# Replace the start script with the non-root version
|
| 27 |
COPY --chmod=755 start_hf.sh /start.sh
|
start_hf.sh
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
# Graceful Shutdown Handler
|
| 4 |
cleanup() {
|
| 5 |
echo "π Shutting down..."
|
| 6 |
-
pkill -TERM
|
| 7 |
sleep 5
|
| 8 |
exit 0
|
| 9 |
}
|
|
@@ -174,7 +174,7 @@ python3 -u /tmp/navigate.py >> /home/chrome/chrome.log 2>&1 &
|
|
| 174 |
|
| 175 |
# 8. Launch Chrome Headless
|
| 176 |
echo "β¨ Launching Chrome Headless..."
|
| 177 |
-
|
| 178 |
--headless=new \
|
| 179 |
--no-sandbox \
|
| 180 |
--disable-setuid-sandbox \
|
|
|
|
| 3 |
# Graceful Shutdown Handler
|
| 4 |
cleanup() {
|
| 5 |
echo "π Shutting down..."
|
| 6 |
+
pkill -TERM -f chrome-linux64 2>/dev/null || true
|
| 7 |
sleep 5
|
| 8 |
exit 0
|
| 9 |
}
|
|
|
|
| 174 |
|
| 175 |
# 8. Launch Chrome Headless
|
| 176 |
echo "β¨ Launching Chrome Headless..."
|
| 177 |
+
/opt/chrome-linux64/chrome \
|
| 178 |
--headless=new \
|
| 179 |
--no-sandbox \
|
| 180 |
--disable-setuid-sandbox \
|