feature/ublock-origin-preinstall #116
1 changed files with 53 additions and 0 deletions
53
build.sh
53
build.sh
|
|
@ -870,6 +870,58 @@ install_live_runtime_packages() {
|
|||
[ "$_mounted_devfs" -eq 1 ] && umount "${MOUNT_POINT}/dev" 2>/dev/null || true
|
||||
}
|
||||
|
||||
install_firefox_extensions() {
|
||||
# Pre-stage uBlock Origin and Bitwarden, and apply enterprise policies
|
||||
# (no default-browser check — Firefox is the only browser on the USB).
|
||||
local _ff_dist="${MOUNT_POINT}/usr/local/lib/firefox/distribution"
|
||||
local _ext_dir="${_ff_dist}/extensions"
|
||||
local _policies="${_ff_dist}/policies.json"
|
||||
|
||||
echo " Configuring Firefox..."
|
||||
|
||||
mkdir -p "${_ext_dir}" || {
|
||||
echo "ERROR: failed to create Firefox distribution directory"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Disable "make default browser" popup — Firefox is the only browser.
|
||||
cat > "${_policies}" <<'POLICIES'
|
||||
{
|
||||
"policies": {
|
||||
"DontCheckDefaultBrowser": true
|
||||
}
|
||||
}
|
||||
POLICIES
|
||||
chmod 0644 "${_policies}"
|
||||
|
||||
# Download a Firefox extension XPI if not already cached.
|
||||
# Usage: _fetch_xpi <slug> <extension-id> <label>
|
||||
_fetch_xpi() {
|
||||
local _slug="$1" _id="$2" _label="$3"
|
||||
local _xpi="${_ext_dir}/${_id}.xpi"
|
||||
local _url="https://addons.mozilla.org/firefox/downloads/latest/${_slug}/latest.xpi"
|
||||
|
||||
if [ -f "${_xpi}" ]; then
|
||||
echo " ${_label} XPI already cached, skipping download"
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo " Downloading ${_label}..."
|
||||
/usr/bin/fetch -o "${_xpi}" "${_url}" || {
|
||||
echo "ERROR: failed to download ${_label} XPI"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
_fetch_xpi "ublock-origin" "uBlock0@raymondhill.net" "uBlock Origin"
|
||||
_fetch_xpi "sponsorblock" "sponsorBlocker@ajay.app" "SponsorBlock"
|
||||
_fetch_xpi "istilldontcareaboutcookies" "idcac-pub@guus.ninja" "I still don't care about cookies"
|
||||
_fetch_xpi "bitwarden-password-manager" "{446900e4-71c2-419f-a6a7-df9c091e268b}" "Bitwarden"
|
||||
|
||||
chmod 0755 "${_ext_dir}"
|
||||
echo " Firefox extensions staged — auto-installed on first launch"
|
||||
}
|
||||
|
||||
install_colibri_service() {
|
||||
[ "${FEATURE_COLIBRI:-NO}" = "YES" ] || {
|
||||
echo " Colibri service staging disabled (FEATURE_COLIBRI=${FEATURE_COLIBRI:-NO})"
|
||||
|
|
@ -2413,6 +2465,7 @@ mkdir -p "$USB_SHARE"
|
|||
rm -f "${MOUNT_POINT}/etc/installerconfig"
|
||||
|
||||
install_live_runtime_packages
|
||||
install_firefox_extensions
|
||||
configure_live_operator_session
|
||||
install_colibri_service
|
||||
install_zot_agent
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue