[Slackbuilds-users] Admins - Question about Brave browser

Dave Woodfall dave at slackbuilds.org
Fri Apr 15 21:15:17 UTC 2022


On 15/04/22 16:27,
Andrew Payne <phalange at komputermatrix.com> put forth the proposition:
> I'll pose this to the admins.
> I would be happy to add this to the readme:
> This slackbuild will adjust MIME settings for Brave. If you
> wish to retain your current MIME settings, you can remove:
> if [ -x /usr/bin/update-mime-database ]; then
>     /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
> fi
> from the doinst.sh file before building.
> ++
> OR pull the MIME lines out of doinst.sh altogether.
> Thoughts?
> >
> >
> > -------- Forwarded Message --------
> > Subject: 	[Slackbuilds-users] Question about Brave browser
> > Date: 	Thu, 24 Mar 2022 10:54:05 -0600
> > From: 	Luveh Keraph <1.41421 at gmail.com>
> > Reply-To: 	SlackBuilds.org Users List <slackbuilds-users at slackbuilds.org>
> > To: 	SlackBuilds.org Users List <slackbuilds-users at slackbuilds.org>
> >
> >
> >
> > I have installed the Brave browser in my 15.0 system using the
> > Slackbuilds software for the purpose. I noticed that, after the
> > installation is completed, some MIME handling settings are silently
> > changed:
> >
> >      $ xdg-mime query default x-scheme-handler/http
> >      brave-browser.desktop
> >
> >      $ xdg-mime query default x-scheme-handler/https
> >      brave-browser.desktop
> >
> > Before installing Brave, the output of these commands was, in my case,
> > chromium.desktop. The default browser setting remains unchanged though:
> >
> >      $ xdg-settings  get default-web-browser
> >       chromium.desktop
> >
> > The above changes imply that when clicking on a link embedded in an
> > email in Thunderbird, the Brave browser will be launched, instead of
> > whatever was the default before - Chromium, in my case.  This is OK if
> > you want to use the Brave browser for that purpose. It is, however, a
> > bit annoying that the changes are carried out under the wraps and
> > without asking the person in charge of the installation of this browser
> > whether such an action is what one wants to do - installing a browser
> > does not necessarily mean that it is meant to become the default browser
> > for MIME data handling.
> >
> > It is easy enough to restore the MIME settings to what they were - in my
> > case I would do
> >
> >      $ xdg-mime default chromium.desktop x-scheme-handler/http
> >      $ xdg-mime default chromium.desktop x-scheme-handler/https
> >
> > However, it would be nice if the installation software were not to
> > change the MIME settings silently, or, at the very least, for the
> > documentation in the Slackbuilds installer to warn about this action and
> > explain how to revert it.
> >
> > Looking into the files in the Slackbuilds installation software it would
> > seem that doinst.sh has something to do with all this, but being totally
> > ignorant about such issues, I wouldn't know - the xdg-mime recipes that
> > I mentioned I got from a network search, they work for me, and that's
> > all I know about them.

You could make it optional and add something like the following to
the slackbuild:

if [ "${BRAVE_MIME:-yes}" = "yes" ]; then
  echo '
if [ -x /usr/bin/update-mime-database ]; then
  /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
fi' >> doinst.sh
fi

to default to yes, or Change the first line to:

if [ "${BRAVE_MIME:-no}" = "yes" ]; then

to default to no.

--
Dave


More information about the SlackBuilds-users mailing list