Ticket #4615: 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>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
This commit is contained in:
Andreas Mohr 2024-12-15 22:00:00 +00:00 committed by Yury V. Zaytsev
parent 511d4d853b
commit e3689b52b1
3 changed files with 11 additions and 11 deletions

View File

@ -213,9 +213,6 @@ if $HAVE_FILECMD; then
fi
fi
dnl Only list browsers here that can be run in background (i.e. with `&')
AC_CHECK_PROGS(X11_WWW, [gnome-moz-remote mozilla firefox konqueror opera])
dnl ############################################################################
dnl Check for other tools
@ -608,7 +605,6 @@ misc/ext.d/Makefile
misc/ext.d/doc.sh
misc/ext.d/misc.sh
misc/ext.d/text.sh
misc/ext.d/web.sh
misc/macros.d/Makefile
misc/mc.ext.ini

View File

@ -3,21 +3,20 @@ extdir = $(EXTHELPERSDIR)
SCRIPTS_IN = \
doc.sh.in \
misc.sh.in \
text.sh.in \
web.sh.in
text.sh.in
SCRIPTS_OUT = \
doc.sh \
misc.sh \
text.sh \
web.sh
text.sh
SCRIPTS_UNTOUCHED = \
archive.sh \
image.sh \
package.sh \
sound.sh \
video.sh
video.sh \
web.sh
ext_SCRIPTS = \
$(SCRIPTS_UNTOUCHED) \

9
misc/ext.d/web.sh.in → misc/ext.d/web.sh Normal file → Executable file
View File

@ -28,8 +28,13 @@ do_open_action() {
case "${filetype}" in
html)
(if [ -n "@X11_WWW@" -a -n "$DISPLAY" ]; then
(@X11_WWW@ file://"${MC_EXT_CURRENTDIR}"/"${MC_EXT_BASENAME}" &) 1>&2
(if [ -n "$DISPLAY" ]; then
for browser in gnome-moz-remote mozilla firefox chromium google-chrome konqueror brave-browser opera open ; do
if which "${browser}" 1>&2 ; then
"${browser}" file://"${MC_EXT_CURRENTDIR}"/"${MC_EXT_BASENAME}" 1>&2 &
break
fi
done
else
elinks "${MC_EXT_FILENAME}" || \
links "${MC_EXT_FILENAME}" || \