The script that gets installed as /usr/bin/brave (https://aur.archlinux.org/cgit/aur.git/tree/brave-bin.sh?h=brave-bin) doesn't quote the extra arguments from brave-flags.conf, which means they get expanded by the shell. So, for instance, if you put "*" in your brave-flags.conf, it will cause all files from the working directory to be opened when brave is started.
Here's a patch to address this:
diff --git a/brave-bin.sh b/brave-bin.sh
index 293a314..0e657ed 100644
--- a/brave-bin.sh
+++ b/brave-bin.sh
@@ -3,10 +3,10 @@ XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
# Allow users to override command-line options
USER_FLAGS_FILE="$XDG_CONFIG_HOME/brave-flags.conf"
-if [[ -f $USER_FLAGS_FILE ]]; then
- USER_FLAGS="$(cat $USER_FLAGS_FILE | sed 's/#.*//')"
+if [[ -f "$USER_FLAGS_FILE" ]]; then
+ mapfile -t USER_FLAGS < <(sed 's/#.*//g' "$USER_FLAGS_FILE")
fi
export CHROME_VERSION_EXTRA="stable"
-exec /usr/lib/brave-bin/brave "$@" $USER_FLAGS
+exec /usr/lib/brave-bin/brave "$@" "${USER_FLAGS[@]}"
Pinned Comments
brave commented on 2025-04-25 13:00 (UTC)