[Chrome] 讓 Chrome 可以另存網頁成 .mht (MHTML) 單一檔案

[Chrome] 讓 Chrome 可以另存網頁成 .mht (MHTML) 單一檔案

今天想在 Chrome 裡面,把一個網頁儲存成 .mht 檔案,

避免平常另存成 .html 時還會跑出另一個目錄放圖檔的麻煩,

意外發現:Chrome 不能另存成 .mht?

 

從下圖可以看到,Chrome 預設只能另存成:

– HTML Only: 就是只有 .html

– Complete: 有 .html 加上一個目錄放圖檔, css 等等

Screen Shot 2017-03-13 at 6.29.56 PM

 

差點就要去裝 Chrome 的擴充功能,來達到這功能了,

幸好在網路上爬文有找到,其實 Chrome 的實驗功能裡就有這個東西 (不曉得為啥這還需要實驗),

用 Chrome 開啟 chrome://flags,找到 Save Page as MHTML,

點下 Enable 啟用這個功能,並且要重新啟動 Chrome:

Screen Shot 2017-03-13 at 6.21.30 PM

 

重新啟動 Chrome 之後,另存的選項就多出一個 Single File,

這會將網頁包含圖檔都直接存在一個 .mhtml 檔案裡面:

Screen Shot 2017-03-13 at 6.27.32 PM

 

在 Mac command line 下要直接用 Chome 開啟這個 .mhtml 的話,

可以用 open -a 的方式開啟,例如:

open -a "Google Chrome" test.mhtml

 

參考資料:How to Enable “Save Page as MHTML” Option in Chrome


2019/6/22 後記:最新的 Google Chrome 已經移除了這個旗標,

但可以在開啟 Chrome 時給參數,這樣仍然會保有此功能。

這是在 Windows 上的方式 (感謝匿名網友提供):

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --save-page-as-mhtml

 

這是在 Mac 上的方式 (要先 Cmd-Q 完整關閉 Chrome 再執行才有用):

open -a "Google Chrome" --args --save-page-as-mhtml
(本頁面已被瀏覽過 15,469 次)

5 thoughts on “[Chrome] 讓 Chrome 可以另存網頁成 .mht (MHTML) 單一檔案

  1. 你好,我安裝了chrome,一直以mhtml存網頁

    突然間沒有這個「mhtml」選項讓我儲存網頁,怎麼辦??

  2. 另存網頁成.mht (MHTML) 單一檔案 單一封包檔 @
    Google removes“Save Page as MHTML”flag from Chrome Canary @June 4, 2019 By Venkat
    ahttps://techdows.com/2019/06/google-removes-save-page-as-mhtml-flag-from-chrome.html
    內容 >捷徑>目標t “C:\Program Files (x86)\Google\Chrome\Application\chrome.exe” –save-page-as-mhtml

    1. 感謝分享,已經將資訊補上,
      順便也補上 Mac 的版本了~

發佈回覆給「匿名訪客」的留言 取消回覆

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料