Opening local shtml file

Support and discussions for the x86/x64 Linux version of Pale Moon and specific Linux distribution questions related to the browser.

Moderator: trava90

Forum rules
If your question is about general use of the browser and not specific to Linux, then please use the General Support board.
Post Reply
User avatar
Lunokhod
Lunatic
Lunatic
Posts: 324
Joined: 2017-04-20, 21:25
Contact:

Opening local shtml file

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
Lunatic
Lunatic
Posts: 360
Joined: 2014-09-01, 15:11
Location: Milan Italy

Re: Opening local shtml file

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
Hobby Astronomer
Hobby Astronomer
Posts: 24
Joined: 2017-03-20, 17:35

Re: Opening local shtml file

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
Lunatic
Lunatic
Posts: 360
Joined: 2014-09-01, 15:11
Location: Milan Italy

Re: Opening local shtml file

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: 28495
Joined: 2011-08-28, 17:27
Location: Tranås, SE
Contact:

Re: Opening local shtml file

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.
"Son, in life you do not fight battles because you expect to win, you fight them merely because they need to be fought." -- Snagglepuss
Image

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

Re: Opening local shtml file

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...

Post Reply