Allow the use of a custom chromium bin

This commit is contained in:
Manuel Thalmann 2023-04-04 03:04:42 +02:00
parent 5b0724ca41
commit 1f5af604ee
3 changed files with 6 additions and 2 deletions

View file

@ -1,4 +1,5 @@
#!/bin/bash
BROWSER_BIN="${BROWSER_BIN}";
EXTENSION_NAME="${EXTENSION_NAME}";
UNPACKED_EXTENSION="${UNPACKED_EXTENSION}";
EXTENSION_DIR="${EXTENSION_DIR}";
@ -20,7 +21,7 @@ else
destination="$EXTENSION_DIR/$EXTENSION_NAME.crx";
sudo -u "$1" brave-browser --pack-extension="$UNPACKED_EXTENSION";
sudo -u "$1" "${BROWSER_BIN}" --pack-extension="$UNPACKED_EXTENSION";
# Tamper manifest file
manifest="$(cat "$manifestFile" | jq ". + {key: "'"'"$(openssl rsa -in "$keyFile" -pubout -outform DER | openssl base64 -A)"'"'"}")";
@ -29,7 +30,7 @@ else
# Pack extension
extensionID="$(openssl rsa -in "$keyFile" -pubout -outform DER | sha256sum | head -c32 | tr 0-9a-f a-p)";
extensionVersion="$(cat "$manifestFile" | jq -r '.version')";
sudo -u "$1" brave-browser --pack-extension="$UNPACKED_EXTENSION" --pack-extension-key="$keyFile";
sudo -u "$1" "${BROWSER_BIN}" --pack-extension="$UNPACKED_EXTENSION" --pack-extension-key="$keyFile";
# Install extension and preinstall it
cp "$extensionFile" "$destination";

View file

@ -1,6 +1,7 @@
#!/bin/bash
pushd "${BASH_SOURCE%/*}" > /dev/null;
BROWSER_BIN="${BROWSER_BIN}";
EXTENSION_DIR="${EXTENSION_DIR}";
EXTENSION_POLICY_DIR="${EXTENSION_POLICY_DIR}";
@ -20,6 +21,7 @@ rm "$archiveName";
manifest="$(cat "$manifestFile" | jq ".background.persistent = false")";
echo "$manifest" > "$manifestFile";
BROWSER_BIN="${BROWSER_BIN}" \
EXTENSION_NAME="youtube-music-dl" \
UNPACKED_EXTENSION="$extensionDir" \
EXTENSION_DIR="${EXTENSION_DIR}" \

View file

@ -8,6 +8,7 @@ source "../../Debian/Software/Brave/install-stable.sh";
source "../../Debian/Software/Brave/install-beta.sh";
source "../../Debian/Software/Brave/install-nightly.sh";
BROWSER_BIN="brave-browser" \
EXTENSION_DIR=/usr/share/brave-extensions \
EXTENSION_POLICY_DIR=/opt/brave.com/brave/extensions \
source "../../Common/Config/Chromium/install-ytmusic-dl.sh";