forked from flathub/org.chromium.Chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chromium.sh
executable file
·34 lines (29 loc) · 817 Bytes
/
chromium.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
merge_extensions() {
(
shopt -s nullglob
dest=/app/chromium/extensions/$1
mkdir -p $dest
for ext in /app/chromium/${1%/*}/$1/*; do
ln -s $ext $dest
done
)
}
unlink_profiles() {
local stamp="$XDG_CONFIG_HOME/chromium-profiles-unlinked-stamp"
if [[ ! -d "$XDG_CONFIG_HOME/chromium" ]]; then
touch "$stamp"
elif [[ ! -f "$stamp" ]]; then
unlink_profiles.py && touch "$stamp"
fi
}
if [[ ! -f /app/chromium/extensions/no-mount-stamp ]]; then
# Merge all legacy extension points if the symlinks had a tmpfs mounted over
# them.
merge_extensions native-messaging-hosts
merge_extensions policies/managed
merge_extensions policies/recommended
fi
# Unlink any profiles from the sync keys to avoid any expected deletions.
unlink_profiles
exec cobalt "$@"