summaryrefslogtreecommitdiffstats
path: root/config/chroot_local-includes/usr/local/bin/getTorBrowserUserAgent
blob: 1e4f2da4697c3788faf976b77b9274bb95f9e292 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

set -eu

# Import the TBB_INSTALL variable
. /usr/local/lib/tails-shell-library/tor-browser.sh

ua="$(unzip -q -p "${TBB_INSTALL}"/browser/omni.ja \
          defaults/preferences/000-tor-browser.js | \
          sed -n 's@^pref("general\.useragent\.override", "\(.*\)");$@\1@p')"

if [ -z "${ua}" ]; then
    echo "Got empty user agent string" >&2
    exit 1
fi

echo "${ua}"