Skip to content

Commit b51da91

Browse files
authored
fix missing foreign language characters, block translation popup (#88)
before: <img width="1924" height="1087" alt="image" src="https://github.com/user-attachments/assets/da6de497-5d63-46d7-b38c-c2f0011ce39e" /> after: <img width="1921" height="1082" alt="image" src="https://github.com/user-attachments/assets/3499d10b-d8da-4948-8659-92c9926d7da2" /> also applied the same policy file to the headless image. Tested this with a vibed up playwright script that connected to the headless image and took a screenshot of coupang.com <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds CJK/emoji fonts and shared Chromium managed policy (disabling translate/autofill/password manager) to both headful and headless images. > > - **Docker images**: > - **Headful (`images/chromium-headful/Dockerfile`)**: > - Install `fontconfig`, `fonts-noto-cjk`, `fonts-noto-color-emoji`, `fonts-nanum`; run `fc-cache -f`; minor cleanup with `apt-get clean`. > - Copy shared Chromium managed policy to `/etc/chromium/policies/managed/policy.json`. > - **Headless (`images/chromium-headless/image/Dockerfile`)**: > - Install `fontconfig`, `fonts-noto-cjk`, `fonts-noto-color-emoji`, `fonts-nanum`; run `fc-cache -f`. > - Copy shared Chromium managed policy to `/etc/chromium/policies/managed/policy.json`. > - **Chromium policies**: > - Add `shared/chromium-policies/managed/policy.json` with `PasswordManagerEnabled`, `AutofillCreditCardEnabled`, and `TranslateEnabled` set to `false`. > - Remove legacy `image-chromium/etc/chromium/policies/managed/autofill.json`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit f8b915f. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent e928eb1 commit b51da91

4 files changed

Lines changed: 25 additions & 7 deletions

File tree

images/chromium-headful/Dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,12 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private,id=ubuntu2204-aptca
114114
xdg-utils \
115115
libvulkan1 \
116116
fonts-liberation \
117-
unzip;
117+
fonts-noto-cjk \
118+
fonts-noto-color-emoji \
119+
fonts-nanum \
120+
fontconfig \
121+
unzip && \
122+
apt-get clean && fc-cache -f
118123

119124
# install ffmpeg manually since the version available in apt is from the 4.x branch due to #drama.
120125
# as of writing these static builds will be the latest 7.0.x release.
@@ -194,6 +199,10 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private,id=ubuntu2204-aptca
194199
apt -y install chromium && \
195200
apt --no-install-recommends -y install sqlite3;
196201

202+
# Copy Chromium policy configuration
203+
RUN mkdir -p /etc/chromium/policies/managed
204+
COPY shared/chromium-policies/managed/policy.json /etc/chromium/policies/managed/policy.json
205+
197206
# install Node.js 22.x by copying from the node:22-bullseye-slim stage
198207
COPY --from=node-22 /usr/local/bin/node /usr/local/bin/node
199208
COPY --from=node-22 /usr/local/lib/node_modules /usr/local/lib/node_modules

images/chromium-headful/image-chromium/etc/chromium/policies/managed/autofill.json

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

images/chromium-headless/image/Dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,13 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private,id=ubuntu2204-aptca
6262
xvfb \
6363
x11-utils \
6464
xdotool \
65+
fontconfig \
66+
fonts-noto-cjk \
67+
fonts-noto-color-emoji \
68+
fonts-nanum \
6569
software-properties-common \
66-
supervisor;
70+
supervisor; \
71+
fc-cache -f
6772

6873
# install chromium and sqlite3 for debugging the cookies file
6974
RUN --mount=type=cache,target=/var/cache/apt,sharing=private,id=ubuntu2204-aptcache \
@@ -75,6 +80,10 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=private,id=ubuntu2204-aptca
7580
apt-get -y install chromium && \
7681
apt-get --no-install-recommends -y install sqlite3;
7782

83+
# Copy Chromium policy configuration
84+
RUN mkdir -p /etc/chromium/policies/managed
85+
COPY shared/chromium-policies/managed/policy.json /etc/chromium/policies/managed/policy.json
86+
7887
# Install FFmpeg (latest static build) for the recording server
7988
RUN --mount=type=cache,target=/tmp/cache/ffmpeg,id=ffmpeg \
8089
<<-'EOT'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"PasswordManagerEnabled": false,
3+
"AutofillCreditCardEnabled": false,
4+
"TranslateEnabled": false
5+
}

0 commit comments

Comments
 (0)