Local html file won't open

Moderator: BarryK

Post Reply
Caramel
Posts: 476
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 100 times
Been thanked: 78 times

Local html file won't open

Post by Caramel »

(EasyOS 5.4.8)

The opening of a local .html file by clicking don't work. The browser opens but the html page is not displayed. Tested with firefox as defaultbrowser and with chromium (via right-click menu)

User avatar
BarryK
Posts: 2709
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 132 times
Been thanked: 739 times

Re: Opening of a local html file

Post by BarryK »

Local html files open ok for me. Tested left-click and right-click chromium and firefox. Running 5.4.8.

Try this in a terminal:

Code: Select all

# firefox /usr/share/doc/cups_shell.htm
Caramel
Posts: 476
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 100 times
Been thanked: 78 times

Re: Opening of a local html file

Post by Caramel »

BarryK wrote: Sat Jul 29, 2023 10:59 am

Local html files open ok for me. Tested left-click and right-click chromium and firefox. Running 5.4.8.

Try this in a terminal:

Code: Select all

# firefox /usr/share/doc/cups_shell.htm

Works (if Firefox is closed, if not there is a message like "already in use")

The html files I tried with have spaces in their names (There are saved web pages). I don't know how to use them in a command line.

n00b
Posts: 14
Joined: Thu Jul 06, 2023 2:43 pm
Been thanked: 2 times

Re: Opening of a local html file

Post by n00b »

Caramel wrote: Sat Jul 29, 2023 8:58 am

(EasyOS 5.4.8)

The opening of a local .html file by clicking don't work. The browser opens but the html page is not displayed. Tested with firefox as defaultbrowser and with chromium (via right-click menu)

Drag the file into the browser.

Caramel
Posts: 476
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 100 times
Been thanked: 78 times

Re: Opening of a local html file

Post by Caramel »

n00b wrote: Sat Jul 29, 2023 12:32 pm
Caramel wrote: Sat Jul 29, 2023 8:58 am

(EasyOS 5.4.8)

The opening of a local .html file by clicking don't work. The browser opens but the html page is not displayed. Tested with firefox as defaultbrowser and with chromium (via right-click menu)

Drag the file into the browser.

Good idea. It works well with Firefox and Chromium.

User avatar
BarryK
Posts: 2709
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 132 times
Been thanked: 739 times

Re: Opening of a local html file

Post by BarryK »

I can confirm, clicking on a html file with a space character, it doesn't open.

Which is odd. I created "/usr/share/doc/cups shell.htm"
When click on it, my understanding is that rox passes all of that as the $1 parameter, to /usr/local/bin/defaultbrowser

OK, inserted
echo "$1" > /tmp/zzz
into /usr/local/bin/defaultbrowser
Yes, the full filename is there.

Right, so Firefox and Chromium are rejecting a filename with a space character.

I edited /usr/local/bin/defaultbrowser, to substitute a space with %20:

Code: Select all

#!/bin/sh
P="$(echo -n "$1" | sed -e 's/ /%20/')"
exec chromium "$P"

Now it works.

Post Reply

Return to “EasyOS”