Package Details: brave-bin 1:1.67.123-1

Git Clone URL: https://aur.archlinux.org/brave-bin.git (read-only, click to copy)
Package Base: brave-bin
Description: Web browser that blocks ads and trackers by default (binary release)
Upstream URL: https://brave.com
Keywords: brave browser
Licenses: BSD, MPL2, custom:chromium
Conflicts: brave
Provides: brave, brave-browser
Submitter: toropisco
Maintainer: alerque (alosarjos)
Last Packager: alosarjos
Votes: 778
Popularity: 13.75
First Submitted: 2016-04-06 13:16 (UTC)
Last Updated: 2024-06-25 16:27 (UTC)

Dependencies (8)

Required by (6)

Sources (4)

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.

Latest Comments

« First ‹ Previous 1 .. 8 9 10 11 12 13 14 15 16 17 18 .. 57 Next › Last »

wknapik commented on 2022-06-02 15:25 (UTC) (edited on 2022-06-02 16:35 (UTC) by wknapik)

@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.

wknapik commented on 2022-06-02 15:02 (UTC) (edited on 2022-06-02 16:00 (UTC) by wknapik)

@heapifyman each option should be on a separate line (and should not be quoted, as the script takes care of that), instead of having multiple options on one line.

So this is bad

--enable-features=UseOzonePlatform --ozone-platform=wayland
--foo="bar baz"

This is good

--enable-features=UseOzonePlatform
--ozone-platform=wayland
--foo=bar baz

Some browser options may accept arguments containing spaces, so breaking up arguments on spaces is tricky. Doable, but the code would have to be aware of the context the space occurs in, so would be considerably more complex.

heapifyman commented on 2022-06-02 07:39 (UTC)

The latest version 1:1.39.111-2 with the patch by @wknampik does not seem to work with the default brave-flags.conf that is installed by Manjaro Sway.

brave-flags.conf has the following content, a single line:

--enable-features=UseOzonePlatform --ozone-platform=wayland

That should make brave run on wayland natively.

With the latest version of brave-bin.sh these settings seem to be ignored. Starting brave and then running xlsclient -a returns brave, meaning it runs on Xwayland, not native wayland, as far as I understand. Running xeyes confirms that - eyes are following mouse cursor when brave is focused.

If I revert the changes to the script then xlsclient -a does not return brave, anymore.

Question: is that an issue with the script or do I (and the Manjaro Sway developers) need to adjust anything in brave-flags.conf?

Spixmaster commented on 2022-05-31 16:00 (UTC) (edited on 2022-05-31 16:00 (UTC) by Spixmaster)

@wknampik is right, @alosarjos. Shebangs exist exactly for this reason to specify the needed shell interpreter. Besides, Bash is a dependency of base. Everybody has Bash.

wknapik commented on 2022-05-30 18:08 (UTC)

@alosarjos bash is a dependency of multiple packages in base-devel, so it's guaranteed to be available. The shebang at the top of brave-bin.sh selects bash as the interpreter, so we're all set. I use zsh myself and this works fine for me.

alosarjos commented on 2022-05-30 14:21 (UTC)

@wknapik I see... The problem there is that bash is not mandatory as default shell, people may be using ZSH, so i tried there the mapfile, and doesn't recognize it, so I can't put that on the AUR script...

wknapik commented on 2022-05-30 10:45 (UTC)

@alosarjos mapfile is a bash builtin that reads lines into an indexed array (see: man bash).

Quotes around a regular variable prevent expansion, but also make the whole value a single commandline argument. Quotes around an array prevent expansion, but each element is quoted separately, which is what we want here.

Please run shellcheck against brave-bin.sh before and after applying the patch to see that this fixes a generic problem.

alosarjos commented on 2022-05-30 09:57 (UTC)

@PQCraft This is the pre-built binaries by Brave. If you think there is an issue with build options I suggest you ask them on their Github repository.

PQCraft commented on 2022-05-30 08:02 (UTC) (edited on 2022-05-30 08:03 (UTC) by PQCraft)

Hi, I have been experiencing a lot of issues where tabs randomly crash with SIGILL. I wonder if this has to do with the build options. Is this being built for generic x86_64?

alosarjos commented on 2022-05-30 06:52 (UTC)

@wknapik Thanks for the patch. But I'm not sure it's correct? What is this mapfile you are adding to it?