mht files
-
I have lots of .mht archive files on my computer that I use for storing my website traffic information. These have been made with the Firefox MozArchiver extension in Palemoon. The source files were originally local html files with most of the images in local folders.
These open fine in Palemoon, Firefox and Internet Explorer - mht was originally designed for IE. But when opened in Vivaldi (and Edge Chromium) some of the images are either missing or replaced by jumbled ascii characters.
As an example see the linked bfcn_apr.mht file and what it should look like below, as shown in Palemoon. Note the website this was made from has long been discontinued. This looks like a Chromium issue as Edge is the same. mht files saved from the web in Vivaldi are generally OK but saving the same local files from there are similarly distorted.
-
@davews Same render bug in Vivaldi 5.1, Edge 96, Chromium 96 & 98.
Works in Opera 9.64 and 12.18 WIn 11. -
@davews Opens just fine in Opera 12.18.
How about saving the pages as PNG images?
-
@davews Ah, you save it from a local drive.
I see, it fails on Chromium browsers with file:// URLs im Webarchives.I checked Error Console in Developer Tools and saw local resources are forbidden to load, could be a security restriction.
-
Thanks DoctorG, that explains it. I had the sneaky feeling it was related to local files but had not noticed the file://. Not sure what the way ahead is..... About the only thing stopping me moving from Palemoon to Vivaldi.
-
Seems the commandline flag to override broken local file access fails in Chromium 96
https://dev.to/dengel29/loading-local-files-in-firefox-and-chrome-m9fPerhaps helps:
https://textslashplain.com/2019/10/09/navigating-to-file-urls/
@davews
/edit:
️
️ You can fix it in webarchive with text editor
(Notepad, Notepad++ etc).
Search allfile://localhost/C:
and replace withhttp://localhost
Works for me and display images now.
-
@doctorg Thanks. But I have several hundred of these files....
But yes, done the mod on my sample file and it indeed works. -
@davews OK, not easy to rename with Windows.
Perhaps a Windows user who know about Powershell or Batch can help.I only know how to replace in text files with command line of Linux.
//EDIT2:
Replace text in all mht files in current folder:
find . -type f -name \*.mht -exec sed -i.bak 's|file://localhost/[A-Za-z]:|http://localhost|g' {} + ;
⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑ ⇑
Works on Windows command line if you install GitforWin32 , use Windows Explorer to run "Git Bash here" by context menu for opening open a Linux-like shell. Then you can type the command.
Feel free to ask me in case of answers or any doubt. -
@doctorg Thanks, will have a play later. It is probably easier that I leave the old ones as they are and open in Palemoon. It is not simple even with a suitable script as they are all archived in .zip files which would need extracting first.
But still remains the second issue in that .mht (or .mhtml) files saved from Vivaldi of the same local .html source files also come with file:// So eventually we need to sort the base issue of permissions. -
Ppafflick moved this topic from Vivaldi for Windows on