@alosarjos please apply also this patch to improve handling of comments and whitespace:
diff --git a/brave-bin.sh b/brave-bin.sh
index 0e657ed..30940d1 100644
--- a/brave-bin.sh
+++ b/brave-bin.sh
@@ -4,7 +4,7 @@ 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
- mapfile -t USER_FLAGS < <(sed 's/#.*//g' "$USER_FLAGS_FILE")
+ mapfile -t USER_FLAGS < <(sed -e 's/\s*#.*//g' -e 's/^\s*//g' -e 's/\s*$//g' "$USER_FLAGS_FILE"|sed -n '/\S/p')
fi
export CHROME_VERSION_EXTRA="stable"
This takes care of trimming whitespace around options and dropping lines that contain no options, which is relevant when you quote everything you pass on the command line.
PS. The approach you took to removing comments (which I haven't changed) would be problematic if a browser option was used with an argument containing the #
character, like --some-option=foo#bar
, but that seems like an unlikely edge case, so I think it's fine to favor simplicity of implementation here.
Pinned Comments
alerque commented on 2021-11-27 03:11 (UTC)
@ant0n et all, lets keep the comments here about packaging issues, general Brave usage issues should go in another forum to not clutter up this comment space. I'm deleting comments that have no relation to packaging. Grey areas like crashes that could be blamed on Arch can stay until proven otherwise, but things like how to configure Brave to handle popups or site X or whatever just don't belong here. Thanks for understanding.