2020-10-07 13:49:40 +05:00
|
|
|
#!/bin/bash -e
|
2019-12-13 09:48:00 -05:00
|
|
|
################################################################################
|
2023-11-22 21:49:23 +01:00
|
|
|
## File: install-firefox.sh
|
|
|
|
|
## Desc: Install Firefox
|
2019-12-13 09:48:00 -05:00
|
|
|
################################################################################
|
|
|
|
|
|
2021-04-02 18:47:50 +03:00
|
|
|
# Source the helpers for use with the script
|
2023-10-16 15:19:04 +02:00
|
|
|
source "$HELPER_SCRIPTS/install.sh"
|
|
|
|
|
source "$HELPER_SCRIPTS/os.sh"
|
2023-11-28 15:19:44 +01:00
|
|
|
source $HELPER_SCRIPTS/etc-environment.sh
|
2021-04-02 18:47:50 +03:00
|
|
|
|
2023-10-16 15:19:04 +02:00
|
|
|
# Mozillateam PPA is added manually because sometimes
|
|
|
|
|
# lanuchad portal sends empty answer when trying to add it automatically
|
|
|
|
|
|
|
|
|
|
repo_url="http://ppa.launchpad.net/mozillateam/ppa/ubuntu"
|
|
|
|
|
gpg_fingerprint="0ab215679c571d1c8325275b9bdb3d89ce49ec21"
|
|
|
|
|
gpg_key="/etc/apt/trusted.gpg.d/mozillateam_ubuntu_ppa.gpg"
|
|
|
|
|
repo_path="/etc/apt/sources.list.d/mozillateam-ubuntu-ppa-focal.list"
|
2022-11-26 13:47:48 +01:00
|
|
|
|
2019-12-13 09:48:00 -05:00
|
|
|
# Install Firefox
|
2023-10-16 15:19:04 +02:00
|
|
|
curl -fsSL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x${gpg_fingerprint}" | sudo gpg --dearmor -o $gpg_key
|
|
|
|
|
echo "deb $repo_url $(getOSVersionLabel) main" > $repo_path
|
|
|
|
|
|
2022-11-26 13:47:48 +01:00
|
|
|
apt-get update
|
|
|
|
|
apt-get install --target-release 'o=LP-PPA-mozillateam' -y firefox
|
2023-10-16 15:19:04 +02:00
|
|
|
rm $repo_path
|
2022-11-26 13:47:48 +01:00
|
|
|
|
|
|
|
|
# Document apt source repo's
|
2023-10-16 15:19:04 +02:00
|
|
|
echo "mozillateam $repo_url" >> $HELPER_SCRIPTS/apt-sources.txt
|
2019-12-13 09:48:00 -05:00
|
|
|
|
2020-04-08 12:47:03 +03:00
|
|
|
# add to gloabl system preferences for firefox locale en_US, because other browsers have en_US local.
|
|
|
|
|
# Default firefox local is en_GB
|
|
|
|
|
echo 'pref("intl.locale.requested","en_US");' >> "/usr/lib/firefox/browser/defaults/preferences/syspref.js"
|
|
|
|
|
|
2020-02-07 13:07:41 +05:00
|
|
|
# Download and unpack latest release of geckodriver
|
2023-11-29 20:25:29 +01:00
|
|
|
download_url=$(get_github_package_download_url "mozilla/geckodriver" "test(\"linux64.tar.gz$\")")
|
|
|
|
|
driver_archive_path=$(download_with_retry "$download_url")
|
2020-02-07 13:07:41 +05:00
|
|
|
|
2020-02-07 15:05:49 +05:00
|
|
|
GECKODRIVER_DIR="/usr/local/share/gecko_driver"
|
|
|
|
|
GECKODRIVER_BIN="$GECKODRIVER_DIR/geckodriver"
|
|
|
|
|
|
|
|
|
|
mkdir -p $GECKODRIVER_DIR
|
2023-11-29 20:25:29 +01:00
|
|
|
tar -xzf "$driver_archive_path" -C $GECKODRIVER_DIR
|
2020-02-07 15:05:49 +05:00
|
|
|
|
2020-02-07 13:07:41 +05:00
|
|
|
chmod +x $GECKODRIVER_BIN
|
2020-02-07 15:05:49 +05:00
|
|
|
ln -s "$GECKODRIVER_BIN" /usr/bin/
|
2023-11-28 15:19:44 +01:00
|
|
|
setEtcEnvironmentVariable "GECKOWEBDRIVER" "${GECKODRIVER_DIR}"
|
2020-02-07 13:07:41 +05:00
|
|
|
|
2020-12-28 11:34:32 +03:00
|
|
|
invoke_tests "Browsers" "Firefox"
|