site  contact  subhomenews

Improved fix for space in HTML filename

March 07, 2026 — BarryK

See post earlier fix:

https://bkhome.org/news/202602/a-better-fix-for-space-in-html-filename.html

But as the guys have discussed in the forum, the fix doesn't work for firefox:

https://forum.puppylinux.com/viewtopic.php?p=165579#p165579

Some tests:

# A='/usr/share/doc/pudd help.htm'

# chromium "${A// /%20}" OK
# chromium "file://${A// /%20}" OK
# chromium "file://${A}" FAIL

# firefox "${A// /%20}" FAIL
# firefox "file://${A// /%20}" OK
# firefox "file://${A}" FAIL

So that they both work, /usr/local/bin/defaultbrowser is now this:

#!/bin/sh
if [ "${1:0:1}" == "/" ];then
exec chromium file://${1// /%20}
else
exec chromium "${1}"
fi

When click on a HTML file in ROX, the full path is passed, so the first character will be "/", so "file://" is pre-pended and any spaces converted to "%20". This works for both chromium and firefox.

Operations in Easy that change defaultbrowser, do it like this, example is in /usr/bin/ff-dl-latest:

sed -i -e 's%^exec [^ ]*%exec firefox %' /usr/local/bin/defaultbrowser

...which is ok for the defaultbrowser script, will only change "chromium" to "firefox", leave everything else as-is.

Next, have to check sc0tman's Defaults Chooser. It was recently modified:

https://bkhome.org/news/202602/default-applications-chooser-fixes.html

...need to make sure it won't corrupt the new defaultbrowser script.   

Tags: easy