baa-conductor


baa-conductor / plugins / baa-firefox / scripts
im_wower  ·  2026-03-22

run-persistent.sh

 1#!/usr/bin/env bash
 2set -euo pipefail
 3
 4SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
 5REPO_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
 6
 7WEB_EXT_BIN="${BAA_WEB_EXT_BIN:-web-ext}"
 8FIREFOX_BIN="${BAA_FIREFOX_BIN:-/Applications/Firefox.app/Contents/MacOS/firefox}"
 9PROFILE_NAME="${BAA_FIREFOX_PROFILE:-baa-firefox-persistent}"
10
11if ! command -v "${WEB_EXT_BIN}" >/dev/null 2>&1; then
12  echo "web-ext not found: ${WEB_EXT_BIN}" >&2
13  exit 1
14fi
15
16if [ ! -x "${FIREFOX_BIN}" ]; then
17  echo "Firefox binary not found: ${FIREFOX_BIN}" >&2
18  exit 1
19fi
20
21exec "${WEB_EXT_BIN}" run \
22  --source-dir "${REPO_DIR}" \
23  --firefox "${FIREFOX_BIN}" \
24  --target firefox-desktop \
25  --firefox-profile "${PROFILE_NAME}" \
26  --keep-profile-changes \
27  --pref=network.proxy.allow_hijacking_localhost=false \
28  --pref=network.proxy.no_proxies_on=localhost,127.0.0.1 \
29  "$@"