MHT Web Archives are complete web pages saved into one file, and is a format browsers like Internet Explorer and Opera can handle. If you like saving complete pages as MHT archives, and need to be able to open all those you saved in Windows, you will need to install Opera, or you can use unMHT plugin for Firefox to give it that functionality.
But if you find that double-clicking an .mht file opens the text editor (which would probably be the case), you’ll need to right-click it and choose to Open With > your web browser, since no mimetype exists for that file extension.
However, to make .mht a registered file-type, you can use a little program called assoGiate. You should be able to install it via Synaptic (if not, you may need more software sources), or you can go to the download page (note that the link for Ubuntu packages currently seems to be dead, but you can get the source code there, if you prefer compiling anyway; otherwise, you can get the i386/32-bit version and amd64/64-bit version here). Once installed, it will end up in Applications > System Tools > File Types Editor.
In assoGiate, use the New button to create a blank mimetype. You’ll see there are 5 tabs in the dialogue box that pops up, and you will be putting information in the first 4. Some just require you to type data in an empty field, while others will require you to click an +Add button to do so. You can copy and paste the required data (in red) from here as you go, to save you typing it.
Description: MHT Web Archive
Use the Browse button […] to select an icon of your choice for the .mht file-type.
► Related Types:
Parent types: message/rfc822
Filename pattern: *.mht
► File contents:
When you click +Add, which you’ll be doing 4 times, you’ll see more than one data entry field, but all you need to worry about is the Value: one.
Value: From: <Saved by
Value: Content-Type: multipart/related;
Value: <!DOCTYPE HTML PUBLIC "-//W3C//DTD
Once your new mimetype has been created, go to the Database menu in assoGiate‘s main window and choose to Export Types… so you can import it again if need be.
Now, I mentioned you can right-click an .mht file and Open With > either Opera or Firefox (if it has the unMHT plugin), but to make either the default program for double-clicking, right-click one, select Properties and go to the Open With tab. There you’ll see some programs you can choose from, with Opera likely to be there. For Firefox, click the +Add button and select ‘Firefox Web Browser‘ from the list of programs that appears. Click Add and close the dialogue box.
Since support for this type is already in Opera, all you’ll see in the address bar is the local url to the file just opened. In Firefox, unMHT handles the opening of the file, so the address will look like:
If you’re wondering whether you could just make your browser open .mht files via the last method, without creating a mimetype, the answer is that you can, but creating a mimetype is much neater. Your .mht files will be listed as “MHT Web Archive“, and have a unique icon; if you had Opera or Firefox opening these files without the mimetype, and you changed the icon for .mht files, you would change the icon for all file-types opened with the specified browser. And as you would have noted, creating the mimetype is actually not that much of a hassle, especially if all the technical data has been supplied.
Check out more examples of creating mimetypes, as well as info on changing file properties and default apps for extensions if need be.
Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!