Opening local shtml file

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
User avatar
Lunokhod
Lunatic
Lunatic
Posts: 469
Joined: 2017-04-20, 21:25
Contact:

Opening local shtml file

Unread post by Lunokhod » 2020-11-04, 14:37

When I try to open a local shtml file I get a dialogue asking what to do with the file, and if I select open with Pale Moon instead of save it shows the same dialogue again ad infinitum. It works in Chromium, but not in Firefox. shtml is not mentioned in /etc/mime.types so perhaps the omission is a bug there, which this page seems to suggest:
http://tuxgraphics.org/npa/open-local-s ... n-firefox/
But perhaps that's a hack and there's a better way. I just wondered if anyone else had any experience with this, and what the correct resolution would be.
Wait, it's all Ohio? Always has been...

Lucio Chiappetti
Astronaut
Astronaut
Posts: 660
Joined: 2014-09-01, 15:11
Location: Milan Italy

Re: Opening local shtml file

Unread post by Lucio Chiappetti » 2020-11-04, 14:49

Does local means residing on your machine http server (URL of type http://) or a local file without http server (URL of type file://) ?

shtml should contain SSI includes, should'nt it ? SSI is server side includes, but for file:// there is no server involved. If there is (http://) it could be instructed to deal with shtml (directives in .htacces or http conf)
The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. (G.B. Shaw)

User avatar
arkaland
Apollo supporter
Apollo supporter
Posts: 36
Joined: 2017-03-20, 17:35

Re: Opening local shtml file

Unread post by arkaland » 2020-11-04, 18:18

:D Lunokhod,
".shtml" is an old HTML-type extension which can be opened by many (if not all) Web browsers. Simply add "shtml" to your /etc/mime.types file in the "text/html" category and the problem should be history.

Lucio Chiappetti
Astronaut
Astronaut
Posts: 660
Joined: 2014-09-01, 15:11
Location: Milan Italy

Re: Opening local shtml file

Unread post by Lucio Chiappetti » 2020-11-04, 19:20

Old like me :D
I do not use .shtml on my own server, where I have AddOutputFilter INCLUDES .html in the Apache config, but I had to use it on the institute server which does not have such directive, specially to have nested includes.

But I never realized it might be barred at browser level (surely my Palemoons do not do it)
The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. (G.B. Shaw)

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35636
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Opening local shtml file

Unread post by Moonchild » 2020-11-04, 19:21

Nothing is barred at the browser level. this is purely a matter of file association in the O.S.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Lunokhod
Lunatic
Lunatic
Posts: 469
Joined: 2017-04-20, 21:25
Contact:

Re: Opening local shtml file

Unread post by Lunokhod » 2020-11-04, 22:59

There seems to be a few issues here concerning shtml.
/etc/mime.types is part of the mailcap package in Arch and Fedora based distros, and shtml does not exist there:
https://pagure.io/mailcap/blob/master/f/mime.types
In Debian based distros /etc/mime.types has a different origin, and was part of the mime-support package which is now being split into mailcap and media-types with media-types containing the file, and shtml does exist here:
https://packages.debian.org/experimental/mime-support
That package also says you should report any missing mime types to IANA, and it seems shtml is not a type recognised by IANA:
https://www.iana.org/assignments/media- ... ypes.xhtml

But as the link in my original post suggested, adding shtml to /etc/mime.types did not make any difference, I also ran update-mime-database /usr/share/mime to see if that helped, and added shtml to the .desktop file for Pale Moon which didn't help either. I was trying to open an shtml file on my file system in the terminal with palemoon file.shtml and also tried opening it from the address bar with file///:pathtofile, copying and pasting from the Chromium address bar which was working. (I could open the same page online without problems.)
Then I tried the making the file described in my original link:
Created this file: ~/.mime.types
text/html shtml
And Pale Moon and Firefox then would open shtml files, even though shtml was not in firefox.desktop (which probably just means it wouldn't be so easily selected via the file manager.)
That link suggests Firefox used to read /etc/mime.types but has stopped doing so. Perhaps it has it's own internal database now, based on the IANA standards, so misses out shtml as a result, like the Arch & Fedora package does?
Wait, it's all Ohio? Always has been...

Locked