Open Siemenskun opened 5 years ago
How was that .mht
file produced? I just re-saved the .html
as .mht
and it worked fine.
Of course it looks like it works fine, because MozArchiver cuts off any included JavaScript while saving. Just look in the source code of your re-saved testcase.mht. Whole text in the textarea is just a plain text, not a script-generated. I made my testcase.mht by hand, but it perfectly reproduce the issue you will encounter if you will open a .mht generated by UnMHT, IE or Opera with Presto engine.
Looking at this a bit more would suggest we do, in fact, purposely remove inline scripts: https://github.com/Lootyhoof/mozarchiver/blob/master/src/chrome/content/saving/ExactPersistParsedJob.js#L733
That said, I'm not entirely sure why this is. Other than not depending on potentially-online components I guess (i.e. something that depends on a server response).
I don't know is it an issue of Pale Moon or MozArchiver, but it worked fine with old Firefox and UnMHT. The event window.onload does not fire. A simple example from MDN (https://developer.mozilla.org/en-US/docs/Web/API/Document/DOMContentLoaded_event#Live_example) give me this if I execute it in a .mht file (testcase.mht in the attachment)
It should be like this (testcase.html in the attachment):
So, many .mht files that rely on some JavaScript are broken. Tested with Pale Moon 28.5.2 and MozArchiver 2.0.1.
testcase.zip