Closed Bug 1523163 Opened 6 years ago Closed 6 years ago

Infinite tabs opening when opening .mht and .mhtml files

Categories

(Firefox :: File Handling, defect)

64 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 218257

People

(Reporter: gameshowhost, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0

Steps to reproduce:

I tried using Firefox to open some single-file web pages (.mht and .mhtml files) which I had saved in other browsers.

Actual results:

The result was catastrophic: Firefox began opening tab after tab, over and over. I couldn't close them, nor could I switch focus to another program, so I couldn't even use Task manager to force the program to shut. In the end, the only way I could get the computer to shut down was to switch it off at the plug, which is something I've never had to do before.

Normally, I would do more testing to see if other pages load properly, or to determine more details about the page that caused the problem, however, this incident was so disturbing and disruptive to my computer that I would be very reluctant to ever use Firefox again to open a saved web page.

  1. Enter about:support into the location bar.
  2. Click the Open Folder button. This opens a file manager window with your Firefox profile folder.
  3. Exit Firefox.
  4. Back in the file manager window, delete the handlers.json file.

If you get a "What should Firefox do with this file?" dialog and you choose to open with Firefox, that will create an infinite loop. That dialog is for external applications only, and you're not supposed to be able to pick Firefox there. To do that safely, use the Open in Browser add-on.

That being said, MHT files aren't supported. As far as I can find, there's no add-on that can handle them since the switch to webextensions.

Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Component: Untriaged → File Handling
Resolution: --- → DUPLICATE
Summary: Crashes when opening .mht and .mhtml files → Infinite tabs opening when opening .mht and .mhtml files

Gingerbread Man, thank you very much for your reply, though your answer confused me a little:

  1. What does deleting handlers.json achieve?
  2. When might I get a "What should Firefox do with this file" dialog?
  3. What does the Open in Browser add-on have to do with viewing saved offline pages?
  4. If MHT files aren't supported by Firefox, wouldn't it be better if Firefox just refused to open them, rather than attempting to open them and crashing?
  1. Deleting handlers.json resets the file associations under about:preferences#general → Applications. This is the safest way to go about it, since there's no way to delete an entry once added and you may have multiple entries for the same file type.
  2. When attempting to open a new file type, when the server sends Content-Type: application/octet-stream or Content-Disposition: attachment, or when attempting to open an unsupported local file type.
  3. The situation you describe isn't unique to local files, which is why I mentioned Open in Browser.
  4. Attempting to open an MHT file normally results in the aforementioned "What should Firefox do with this file?" dialog, where Internet Explorer is selected by default, since it's the program associated with that file type. Here's a screenshot of it. You got infinitely spawning tabs because at some point you selected Firefox in that dialog.

Just to clarify a couple of details:

If I double-click MHTML files in Windows, they open in Google Chrome, which is the program I used to save them. I used to use Internet Explorer, but Chrome is a far better browser so I uninstalled IE some time ago. (The only reason I use these alternative browsers is for the purpose of saving web pages.)

The way I opened the files was by dragging them directly into Firefox - since Firefox is my preferred browser, and I don't want to use Chrome for anything. This is how I've always opened offline saved pages, by dragging them into Firefox, and I've never had any problems doing so in the past, but then again, I always used to use regular HTML files, and they seem to load fine.

If you mean Firefox should support the MHT format, that's bug 40873. Other than that, there's really nothing to add.

  • If you have another browser associated with MHT files, that would be the default option in the aforementioned dialog instead of the usual Internet Explorer.
  • It also doesn't matter if you open the file through drag and drop, File → Open / Ctrl+O, or the address bar.
  • It doesn't matter what the file type is, only if you created a loop by telling Firefox to open that file type with Firefox in the aforementioned attachment 9039455 [details] dialog (thankfully, it's not possible to create this loop directly in about:preferences#general → Applications section).

Here's my problem in a nutshell: When I dragged the file into Firefox, I expected for it either to load the page, or tell me it cannot load the page. I did not expect it to severely crash my machine.

Solution: If someone drags an MHT or MHTLM file into Firefox, Firefox should do nothing, or say "Firefox cannot load this type of file".

We're just going around in circles here. One last time: default behavior is to ask what to do with the file, as shown in attachment 9039455 [details]. What you describe can only happen when

  • You tell Firefox to open the file with Firefox. That's what this report is a duplicate of.
  • The file in question is associated with Firefox. That's bug 215554.

I will not comment further.

To my recollection, I was given no warning that Firefox does not support MHT files and may crash if the file is opened. Since Firefox is a web browser, I assumed it would be able to handle the most common types of web files. After 16 years of this bug being open, isn't it time that Firefox bore a warning about this dangerous shortcoming? (Rhetorical question, no reply needed.)

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: