How to create MHTML standalone file with same page links

时光怂恿深爱的人放手 提交于 2019-12-04 05:10:54

问题


How do you export an MHTML standalone webpage from google chrome that has correctly operating same page links?

For instance, download this working example and open it in Chrome from your local machine:

<!DOCTYPE html>
<html>
<body>

<p>
<a href="#C4">See also Chapter 4.</a>
</p>

<h2>Chapter 1</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 2</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 3</h2>
<p>This chapter explains ba bla bla</p>

<h2><a id="C4">Chapter 4</a></h2>
<p>This chapter explains ba bla bla</p>

</body>
</html>

Now save it as an MHTML file and try opening that MHTML version from your local machine. The hyperlink does not respond to a left mouse click.

However, the link will work if you:

  • manually type the hyperlink into the address bar: file:///C:/Users/usr/Desktop/test.html#C4

  • right click on the hyperlink and select "open in new tab"

So clearly the link still exists, which is further evidenced by hovering over it:

So why can't a left mouse click trigger the hyperlink like it did for the .html version?

This problem doesn't seem to exist for IE (at least for this example) and I have chrome Version 35.0.1916.114 m. It would be nice to know a general, platform independent solution to not restrict which browser is used to open the MHTML


回答1:


I use singlefile, a chrome extension found on the Chrome store, it produces MHTML files

https://chrome.google.com/webstore/detail/singlefile/mpiodijhokgodhhofbcjdecpffjipkle



来源:https://stackoverflow.com/questions/24102712/how-to-create-mhtml-standalone-file-with-same-page-links

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!