forked from endlessm/firefox-flatpak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapply_extra
32 lines (25 loc) · 934 Bytes
/
apply_extra
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
#!/bin/sh
# Install Firefox binaries
# Extracts into the 'firefox' folder
tar xjf firefox.tar.bz2
rm firefox.tar.bz2
FIREFOX_DIR=$(pwd)/firefox
# Install languages
# Retrieve the extension id for an addon from its install.rdf
# This function is taken from http://kb.mozillazine.org/Determine_extension_ID
get_extension_id() {
unzip -qc $1 install.rdf | xmlstarlet sel \
-N rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns# \
-N em=http://www.mozilla.org/2004/em-rdf# \
-t -v \
"//rdf:Description[@about='urn:mozilla:install-manifest']/@em:id"
}
EXTENSIONS_DIR=${FIREFOX_DIR}/distribution/extensions
mkdir -p ${EXTENSIONS_DIR}
for addon in $(ls *.xpi); do
mv "${addon}" "${EXTENSIONS_DIR}/$(get_extension_id ${addon}).xpi"
done
# Override preferences
PREFERENCES_DIR=${FIREFOX_DIR}/browser/defaults/preferences
mkdir -p ${PREFERENCES_DIR}
ln -s /app/cache/mozilla/endless-default-prefs.js ${PREFERENCES_DIR}