From a93e522c7202d9b25aefb8f8d8364a1dce678df3 Mon Sep 17 00:00:00 2001
From: Andreas Mohr <and@gmx.li>
Date: Sun, 15 Dec 2024 22:00:00 +0000
Subject: [PATCH] (web.sh) select browser at runtime
Current browser selection happen on compile time and should change to runtime selection.
- add chromium browser to list
- bonus: remove shellcheck warning
Signed-off-by: Andreas Mohr <and@gmx.li>
---
configure.ac | 3 ---
misc/ext.d/web.sh.in | 9 +++++++--
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index a3761a4ee..237c9a982 100644
a
|
b
|
if $HAVE_FILECMD; then |
213 | 213 | fi |
214 | 214 | fi |
215 | 215 | |
216 | | dnl Only list browsers here that can be run in background (i.e. with `&') |
217 | | AC_CHECK_PROGS(X11_WWW, [gnome-moz-remote mozilla firefox konqueror opera]) |
218 | | |
219 | 216 | |
220 | 217 | dnl ############################################################################ |
221 | 218 | dnl Check for other tools |
diff --git a/misc/ext.d/web.sh.in b/misc/ext.d/web.sh.in
index 17d7e6354..c86fc7d21 100644
a
|
b
|
do_open_action() { |
28 | 28 | |
29 | 29 | case "${filetype}" in |
30 | 30 | html) |
31 | | (if [ -n "@X11_WWW@" -a -n "$DISPLAY" ]; then |
32 | | (@X11_WWW@ file://"${MC_EXT_CURRENTDIR}"/"${MC_EXT_BASENAME}" &) 1>&2 |
| 31 | (if [ -n "$DISPLAY" ]; then |
| 32 | for browser in gnome-moz-remote mozilla firefox konqueror opera chromium ; do |
| 33 | if which "${browser}" 1>&2 ; then |
| 34 | "${browser}" file://"${MC_EXT_CURRENTDIR}"/"${MC_EXT_BASENAME}" 1>&2 & |
| 35 | break |
| 36 | fi |
| 37 | done |
33 | 38 | else |
34 | 39 | elinks "${MC_EXT_FILENAME}" || \ |
35 | 40 | links "${MC_EXT_FILENAME}" || \ |