Once upon a time, in a land not far away, I created an Intranet site for my former company. This was back in the 2000s. It was a relatively simple static HTML site but certain page elements were pulled via Server Side Includes. I keep copies of that and other static HTML sites I created in local directories on my PC, not in a local server like /srv/www, there's no need, just in my home directory. I can still view all my other sites from there no problem in Firefox. I haven't looked at that Intranet site for a year or two, but now it doesn't work. Only the initial index.html page is plain HTML with no SSI, and fully viewable. All the other pages have an .shtml extension, so in the past I would have to forgo seeing certain non-loaded page elements in menus and title bars, and just navigate using the links in the main part of the view, which was good enough to still access all the main content. Now, clicking a link in Firefox from the index to any other page brings up a dialog box requesting which program I want to use to open the file. Firefox itself is the only suggestion and hence default option, so if I click OK it opens a new blank tab and throws up the dialog box again, and again, for eternity, without showing the page. The only two browsers I have installed on 15.4 are Firefox and Konqueror. I tried copying and pasting the URL into Konqueror, but when I hit Enter it just switches back to Firefox and presents the same dialog box. Indeed, I note that now Konqueror will only show pages on the web and doesn't want to show any local page, always directing me back to Firefox. This wasn't the case in the past. I've looked in Konqueror's settings and tried using the different view modes, e.g. KHTML, WebKit, but can't find a workaround there. I assume there's some security-based rationale for not showing these pages but I don't know at what level and whether I can override it. I've checked in Dolphin that shtml files are associated by default to open with Firefox. Anybody know a config option or other way to view such pages, or a browser which definitely still displays them? gumb
On 01/08/2022 10:57, gumb wrote:
main content. Now, clicking a link in Firefox from the index to any other page brings up a dialog box requesting which program I want to use to open the file.
This is almost certainly because the file is being "served" with an incorrect MIME-type. Your browser doesn't know what to do with an .shtml file.
I assume there's some security-based rationale for not showing these pages
No, I don't think so - Firefox simply does not know what they are, whether text or html. Maybe earlier Firefoxes made assumptions.
Anybody know a config option or other way to view such pages, or a browser which definitely still displays them?
I wonder if maybe amending /etc/mime.types would help: text/html html htm shtml On my 15.2 system, it's in line 1689. /Per
On 2022-08-02 09:18, Per Jessen wrote:
On 01/08/2022 10:57, gumb wrote:
...
Anybody know a config option or other way to view such pages, or a browser which definitely still displays them?
I wonder if maybe amending /etc/mime.types would help:
text/html html htm shtml
On my 15.2 system, it's in line 1689.
On my 15.3 it is gone. -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
On 2022-08-02 13:53, Carlos E. R. wrote:
On 2022-08-02 09:18, Per Jessen wrote:
On 01/08/2022 10:57, gumb wrote:
...
Anybody know a config option or other way to view such pages, or a browser which definitely still displays them?
I wonder if maybe amending /etc/mime.types would help:
text/html html htm shtml
On my 15.2 system, it's in line 1689.
On my 15.3 it is gone.
Same on TW. You can also stick it in $HOME/.mime.types if you don't want it gone by next up or dup. $ strace -o firefox.log firefox && egrep mime.types firefox.log openat(AT_FDCWD, "/home/bengan/.mime.types", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/mime.types", O_RDONLY) = 133 openat(AT_FDCWD, "/home/bengan/.mime.types", O_RDONLY) = -1 ENOENT (No such file or directory) -- /bengan
On 02/08/2022 14:13, Bengt Gördén wrote:
On 2022-08-02 13:53, Carlos E. R. wrote:
On 2022-08-02 09:18, Per Jessen wrote:
On 01/08/2022 10:57, gumb wrote:
...
Anybody know a config option or other way to view such pages, or a browser which definitely still displays them?
I wonder if maybe amending /etc/mime.types would help:
text/html html htm shtml
On my 15.2 system, it's in line 1689.
On my 15.3 it is gone.
Same on TW. You can also stick it in $HOME/.mime.types if you don't want it gone by next up or dup.
$ strace -o firefox.log firefox && egrep mime.types firefox.log openat(AT_FDCWD, "/home/bengan/.mime.types", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/mime.types", O_RDONLY) = 133 openat(AT_FDCWD, "/home/bengan/.mime.types", O_RDONLY) = -1 ENOENT (No such file or directory)
I don't understand what this last paragraph is or does. Do I create a copy of /etc/mime.types to put at $HOME/.mime.types, or just a new blank text file with the one relevant modified line text/html html htm shtml ? And does anything need restarting or rebooting afterwards for it to take effect?
On 2022-08-03 11:47, gumb wrote:
On 02/08/2022 14:13, Bengt Gördén wrote:
$ strace -o firefox.log firefox && egrep mime.types firefox.log openat(AT_FDCWD, "/home/bengan/.mime.types", O_RDONLY) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/mime.types", O_RDONLY) = 133 openat(AT_FDCWD, "/home/bengan/.mime.types", O_RDONLY) = -1 ENOENT (No such file or directory)
I don't understand what this last paragraph is or does.
It runs strace (trace system calls and signals) and saves log to firefox.log. When you quit firefox the next command (after &&) is run and greps for "mime.types" in the file firefox.log It was just to show you that firefox opens $HOME/.mime.types and /etc/mime.types. strace is a nice thing to trace system calls of a program. I use it if something has gone wrong or if I just want to see what the heck a program is doing, syscall-wise that is.
Do I create a copy of /etc/mime.types to put at $HOME/.mime.types, or just a new blank text file with the one relevant modified line text/html html htm shtml ? And does anything need restarting or rebooting afterwards for it to take effect?
A blank file with the modified line is enough. this creates or adds that to your file. echo "text/html html htm shtml" >> $HOME/.mime.types -- /bengan
On 03/08/2022 13:30, Bengt Gördén wrote:
It runs strace (trace system calls and signals) and saves log to firefox.log. When you quit firefox the next command (after &&) is run and greps for "mime.types" in the file firefox.log
It was just to show you that firefox opens $HOME/.mime.types and /etc/mime.types. strace is a nice thing to trace system calls of a program. I use it if something has gone wrong or if I just want to see what the heck a program is doing, syscall-wise that is.
<snip>
A blank file with the modified line is enough.
this creates or adds that to your file. echo "text/html html htm shtml" >> $HOME/.mime.types
Thanks for the explanation. Yes that worked. Didn't need to restart Firefox, the changed was effected immediately. What might have changed to make this no longer work by default? Is it likely Firefox itself or a system config option? I can't say for sure if this has only occurred since updating from 15.3 to 15.4 a few weeks ago, or if it happened before that, because it's probably at least a year since I last tried to view this Intranet site. I just wonder if it's a bug or a 'feature'.
On 2022-08-03 16:26, gumb wrote:
On 03/08/2022 13:30, Bengt Gördén wrote:
It runs strace (trace system calls and signals) and saves log to firefox.log. When you quit firefox the next command (after &&) is run and greps for "mime.types" in the file firefox.log
It was just to show you that firefox opens $HOME/.mime.types and /etc/mime.types. strace is a nice thing to trace system calls of a program. I use it if something has gone wrong or if I just want to see what the heck a program is doing, syscall-wise that is.
<snip>
A blank file with the modified line is enough.
this creates or adds that to your file. echo "text/html html htm shtml" >> $HOME/.mime.types
Thanks for the explanation. Yes that worked. Didn't need to restart Firefox, the changed was effected immediately.
What might have changed to make this no longer work by default? Is it likely Firefox itself or a system config option? I can't say for sure if this has only occurred since updating from 15.3 to 15.4 a few weeks ago, or if it happened before that, because it's probably at least a year since I last tried to view this Intranet site. I just wonder if it's a bug or a 'feature'.
Did you look at the date of the files? -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
On 2022-08-03 19:17, gumb wrote:
On 03/08/2022 18:14, Carlos E. R. wrote:
Did you look at the date of the files?
~> l /etc/mime.types -rw-r--r-- 1 root root 102925 Apr 9 2018 /etc/mime.types
Created 06/04/2022
Same as mine, on 15.2 and 15.3. None has the line for shtml. Per has the line on 15.4, so when is that file dated? I looked on copies of old machines: Telcontar:~ # grep shtml /data/vmware/bck/OpenSuSE\ 11.1/etc/mime.types Telcontar:~ # grep shtml /data/vmware/bck/openSUSE\ 11.0/etc/mime.types Telcontar:~ # Telcontar:~ # grep shtml /data/storage_b/other_main_xtr/backup/Del\ \ 9.3\ al\ 10.1/etc/mime.types.rpmsave Telcontar:~ # As far as I can see, shtml was never in /etc/mime.types I should have a copy of 5.3 somewhere, I could check. So, the reason why FF doesn't open the files now can not be a changed mime.types file. -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
On 03/08/2022 20:02, Carlos E. R. wrote:
Same as mine, on 15.2 and 15.3. None has the line for shtml.
Per has the line on 15.4, so when is that file dated?
The way I read Per's first reply, below, shtml wasn't already in the file, rather it was suggested to add it to the line and thus an example given:
I wonder if maybe amending /etc/mime.types would help:
text/html html htm shtml
On my 15.2 system, it's in line 1689.
And in the other reply, that's still how i read it:
On Leap 15.4, I have /etc/mime.types, supplied by aaa_base-84.87+git20180409.04c9dae-3.57.1.x86_64
"text/html" is still in line 1689
There's nothing to suggest shtml was already included in that line. So it's likely either a Firefox thing or some other system-wide change. I'm curious as to whether other browsers also deny access but don't really want to download and install all other browsers just to test that out. gumb
On 2022-08-03 16:26, gumb wrote:
What might have changed to make this no longer work by default?
I'm not really sure. Couldn't find anything about it but since it's an SSI (server side include) it's more likely to be processed by the http server and not the browser. But that's the only thing I can think of. But mime.types isn't exclusive to browsers so that sounds wrong too.
Is it likely Firefox itself or a system config option? I can't say for sure if this has only occurred since updating from 15.3 to 15.4 a few weeks ago, or if it happened before that, because it's probably at least a year since I last tried to view this Intranet site.
If you have snapper going you could try to find it in /.snapshots sudo find /.snapshots/ -name mime.types Or check the zypp log at /var/log/zypp/ It's in the package aaa_base-84 Check package with: rpm -qf /etc/mime.types
I just wonder if it's a bug or a 'feature'.
Most likely a feature. Maybe from the mime.types from apache or maybe some other package included it in /etc/mime.types. I can't find it anywhere in the repo at github. See history: https://github.com/openSUSE/aaa_base/commits/master/files/etc/mime.types -- /bengan
On 03/08/2022 18:15, Bengt Gördén wrote:
It's in the package aaa_base-84
Check package with: rpm -qf /etc/mime.types
The last update to aaa_base was with the upgrade to 15.4 - there's not been any updated package since then.
Most likely a feature. Maybe from the mime.types from apache or maybe some other package included it in /etc/mime.types. I can't find it anywhere in the repo at github.
See history: https://github.com/openSUSE/aaa_base/commits/master/files/etc/mime.types
I looked at the changelog in YaST, which is extensive but doesn't make any reference to the mime.types file. If I felt sure it were a bug I'd report it, because I might be the only person who is affected and so it's a quirk for which I'll forever have to make a workaround, but it's not clear where or how the change has come about so I'll leave it at that. However, the html previews being broken in Dolphin seems like a bug. gumb
On 02/08/2022 13:53, Carlos E. R. wrote:
On 2022-08-02 09:18, Per Jessen wrote:
On 01/08/2022 10:57, gumb wrote:
...
Anybody know a config option or other way to view such pages, or a browser which definitely still displays them?
I wonder if maybe amending /etc/mime.types would help:
text/html html htm shtml
On my 15.2 system, it's in line 1689.
On my 15.3 it is gone.
Weird. On Leap 15.4, I have /etc/mime.types, supplied by aaa_base-84.87+git20180409.04c9dae-3.57.1.x86_64 "text/html" is still in line 1689 :-) However, I certainly vote for Bengt's suggestion of a local change in $HOME/.mime.types. /Per
On 2022-08-03 08:40, Per Jessen wrote:
On 02/08/2022 13:53, Carlos E. R. wrote:
On 2022-08-02 09:18, Per Jessen wrote:
On 01/08/2022 10:57, gumb wrote:
...
Anybody know a config option or other way to view such pages, or a browser which definitely still displays them?
I wonder if maybe amending /etc/mime.types would help:
text/html html htm shtml
On my 15.2 system, it's in line 1689.
On my 15.3 it is gone.
Weird.
On Leap 15.4, I have /etc/mime.types, supplied by aaa_base-84.87+git20180409.04c9dae-3.57.1.x86_64
"text/html" is still in line 1689 :-)
Weird, yes. cer@Telcontar:~> grep shtml /etc/mime.types .mime.types cer@Telcontar:~> Maybe your 15.4 machine is not fully updated, and a recent update removed the line? :-? :-o No... cer@Telcontar:~> grep shtml /etc/mime.types .mime.types cer@Telcontar:~> l /etc/mime.types .mime.types -rw-r--r-- 1 cer users 1565 Jun 8 2008 .mime.types -rw-r--r-- 1 root root 102925 Apr 9 2018 /etc/mime.types cer@Telcontar:~> See how old is my file... cer@Telcontar:~> rpm -qf /etc/mime.types aaa_base-84.87+git20180409.04c9dae-3.57.1.x86_64 cer@Telcontar:~> Apparently the same file as you have.
However, I certainly vote for Bengt's suggestion of a local change in $HOME/.mime.types.
I found some shtml files in my disk, and I can replicate the problem. Thus I edit .mime.types, and the files load. -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
On 03/08/2022 11:42, Carlos E. R. wrote:
cer@Telcontar:~> grep shtml /etc/mime.types .mime.types cer@Telcontar:~>
Carlos, my suggestion was for gumb to _add_ "shtml" to that line. Hence Bengt's sensible suggestion of using ~/.mime.types.
However, I certainly vote for Bengt's suggestion of a local change in $HOME/.mime.types.
I found some shtml files in my disk, and I can replicate the problem. Thus I edit .mime.types, and the files load.
Nice, thanks for confirming. /Per
This is old FF bug: http://ds.tuxgraphics.org/npa/open-local-shtml-files-in-firefox/ Works OK with Vivaldi. Try to use Chrome/Chromiums. Or change extension, or patch system settings. Test case: create new blank html file, change extension to shtml.
On 2022-08-04 09:04, Per Jessen wrote:
On 03/08/2022 11:42, Carlos E. R. wrote:
cer@Telcontar:~> grep shtml /etc/mime.types .mime.types cer@Telcontar:~>
Carlos, my suggestion was for gumb to _add_ "shtml" to that line. Hence Bengt's sensible suggestion of using ~/.mime.types.
Yes, but I understood you said that your 15.4 machine had the line already in the system provided file. For example, you said: ]> I wonder if maybe amending /etc/mime.types would help: ]>]> text/html html htm shtml ]> ]> On my 15.2 system, it's in line 1689. But I have a 15.2 system here and it doesn't have the line. So my question, my doubt, is how your system came to have that line in /etc/mime.types file: maybe you edited it yourself?
However, I certainly vote for Bengt's suggestion of a local change in $HOME/.mime.types.
I found some shtml files in my disk, and I can replicate the problem. Thus I edit .mime.types, and the files load.
Nice, thanks for confirming.
-- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
Carlos E. R. wrote:
On 2022-08-04 09:04, Per Jessen wrote:
On 03/08/2022 11:42, Carlos E. R. wrote:
cer@Telcontar:~> grep shtml /etc/mime.types .mime.types cer@Telcontar:~>
Carlos, my suggestion was for gumb to _add_ "shtml" to that line. Hence Bengt's sensible suggestion of using ~/.mime.types.
Yes, but I understood you said that your 15.4 machine had the line already in the system provided file.
I know, you misunderstood. Anyway, no need to harp on about that, gumb understood perfectly well what I meant. I'm just slightly surprised it worked so well :-) -- Per Jessen, Zürich (21.8°C)
On 02/08/2022 09:18, Per Jessen wrote:
On 01/08/2022 10:57, gumb wrote:
Anybody know a config option or other way to view such pages, or a browser which definitely still displays them?
I wonder if maybe amending /etc/mime.types would help:
text/html html htm shtml
On my 15.2 system, it's in line 1689.
I'll try that one later. I was fiddling earlier with what must be a related setting within Plasma's own System Settings (Applications -> File Associations), whereupon the listed item 'text -> html' contains the extensions .htm and .html by default (exactly as noted in my mime.types file). I added .shtml and .xhtml but haven't noticed anything different as a result. There's something else odd though. In addition to local copies of my own websites, I have hundreds of other html files of downloaded saved webpages and the like, in various locations. Within Dolphin, I always used to see previews of these files, but now they just show a blank document icon. I looked in Dolphin's configuration, and under General -> Previews I saw that 'Web Archives and HTML files' was one of only two items unchecked in the list. Maybe the preview backend has changed with a Plasma upgrade, because I had it checked in the past. So I've ticked that option and OK'd the dialog, but still no HTML file previews, even after a reboot. Had a look in YaST Software Management and searched for HTML and preview in case I'm missing a dependency, but don't see anything obvious. gumb
participants (6)
-
Bengt Gördén
-
Carlos E. R.
-
gumb
-
Nikolai Nikolaevskii
-
Per Jessen
-
Per Jessen