blob: a1ddae8c7883db8db4e7106cf6db7ab42f7b709e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#!/usr/bin/env bash
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
BRAVE_USE_FLASH_IF_AVAILABLE="${BRAVE_USE_FLASH_IF_AVAILABLE:-true}"
# 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/#.*//')"
fi
[[
( -r $(echo /proc/config.*)
&& -z $(bsdcat /proc/config.* | grep CONFIG_USER_NS=y) )
|| ( -r /proc/sys/kernel/unprivileged_userns_clone
&& $(< /proc/sys/kernel/unprivileged_userns_clone) != 1 )
]] && SANDBOX_FLAG="--no-sandbox" && echo "User namespaces are not detected as enabled on your system, Brave will run with the sandbox disabled"
BRAVE_PEPPER_FLASH_SO=${BRAVE_PEPPER_FLASH_SO:-/usr/lib/PepperFlash/libpepflashplayer.so}
if [[ -f $BRAVE_PEPPER_FLASH_SO && $BRAVE_USE_FLASH_IF_AVAILABLE == "true" ]]; then
BRAVE_PEPPER_FLASH_VERSION=${BRAVE_PEPPER_FLASH_VERSION:-$(LANG=C pacman -Qi pepper-flash | grep Version | sed 's/.*: //; s/\-[^-]*$//')}
PEPPER_FLASH_FLAG="--ppapi-flash-path=$BRAVE_PEPPER_FLASH_SO --ppapi-flash-version=$BRAVE_PEPPER_FLASH_VERSION"
fi
# OR true included because Brave currently segfaults when a second
# window is opened from running the brave binary.
# GH Issue: https://github.com/brave/brave-browser/issues/4142
# NOTE: Replace with an exec call once we don't have to work around
# this bug by having the browser be a subprocess of this script
/usr/lib/brave/brave $@ $SANDBOX_FLAG $PEPPER_FLASH_FLAG $USER_FLAGS || true
|