为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Firefox-esr 68.7.0 local opened .shtml causes repeated tab opens of blank page.

more options

Using firefox-esr 68.7.0 on Raspberry PI4, Linux 10 (buster). Firefox handles the online .shtml webpages properly at: http://www.buczynski.com. All webpage files were downloaded to RPi using FileZilla. Used File=>Open File to open the local index.shtml file. This results in repeated new tabs opening. Using upper right X to close firefox results in the application relaunching and attempting recovery repeating the same problem. RPi reboot is the only way to recover from the problem.

There are a number of other .shtml files and they all experience the same behavior when opened locally. If a .shtml file is copied to have a .html extension, the locally opened file displays properly.

Problem does not occur on Windows 7 box, Firefox 75.0 (64 bit) when the index.shtml file is opened locally.

Using firefox-esr 68.7.0 on Raspberry PI4, Linux 10 (buster). Firefox handles the online .shtml webpages properly at: http://www.buczynski.com. All webpage files were downloaded to RPi using FileZilla. Used File=>Open File to open the local index.shtml file. This results in repeated new tabs opening. Using upper right X to close firefox results in the application relaunching and attempting recovery repeating the same problem. RPi reboot is the only way to recover from the problem. There are a number of other .shtml files and they all experience the same behavior when opened locally. If a .shtml file is copied to have a .html extension, the locally opened file displays properly. Problem does not occur on Windows 7 box, Firefox 75.0 (64 bit) when the index.shtml file is opened locally.

所有回复 (8)

more options

Sounds that you have created an automatic download action for the .shtml file extension. You can check the handlers.json file in the profile folder.

See also:

more options

Configured to have Firefox prompt when opening the .shtml file. See config and handlers.json attachments. Opened the index.shtml file and captured 3 iterations of the problem. When OK was selected, another tab was opened and prompt presented. Attachment shows the page opened from webserver. The issue only occurs when the .shtml file is locally opened.

more options

Locally opened using Chromium.

more options

If you get a prompt to select an application when you open a file with Firefox then this means that Firefox doesn't support this file type (extension) and you shouldn't open this file using Firefox because that will repeat the open dialog.

I can open a .shtml file without problems in Firefox. Try to remove that .shtml section from handlers.json as you may have associated this file extension with an unsupported MIME type.

more options

Tried with the .shtml removed; repeating prompt still occurs. Snapshot of handlers.json files used are attached. The /etc/mime.types file defines shtml as text/html. Found definitions for application/x-extension-shtml in /home/pi/.local/share/mime/application and /home/pi/.local/share/mime/packages.

I understand that Firefox would prompt for an action when encountering an unknown file type. With the .shtml definition present in handlers.json, Firefox knows how to handle it. The .shtml definition in handlers.json is likely not the root cause of the repetitive behavior. Firefox does not properly process the .shtml mime type when locally opened on my system.

Since opening a .shtml file works with your Firefox, can you provide some details about the Firefox version and system environment?

more options

Hi Don, where do you think Firefox learns the MIME-type of a file opened from the file system (not from a web server, which sends the Content-Type header)? If it is from one of the *-extension-shtml.xml files, try changing the content type to text/html and see whether Firefox likes it better.

more options

~/.config/mimeapps.list is the only place I'm aware of for making your suggested change. You'll need to be more specific if additional changes are required elsewhere.

The problem can be worked around by editing the ~/.config/mimeapps.list file; see attachment. In addition to the added lines, existing lines for x-extension-shtml must be comment out. (adverse effects?) No changes to the handlers.json file are needed.

more options

Don said

~/.config/mimeapps.list is the only place I'm aware of for making your suggested change. You'll need to be more specific if additional changes are required elsewhere.

I was looking at your previous screenshots. The user-extension-shtml.xml file seemed to be where you would tell the system that the preferred MIME type of

whatever.shtml

is

text/shtml

instead of

application/x-extension-shtml

But I'm a Windows person so there are many things I don't know about Linux.

The problem can be worked around by editing the ~/.config/mimeapps.list file; see attachment. In addition to the added lines, existing lines for x-extension-shtml must be comment out. (adverse effects?)

Sounds good.