Skip to content
Danny Lin edited this page Jan 20, 2024 · 15 revisions

View Archive Files

Every HTZ or MAFF archive file saved by WebScrapBook is essentially a ZIP-compressed file, and therefore can always be viewed by extracting using a ZIP software and viewing the containing files.

The entry page of a HTZ file is always index.html. A MAFF file has each page inside a subfolder with an entry index.* specified by index.rdf (see specification).

View with the archive page viewer

WebScrapBook has a built-in archive page viewer accessible from the dropdown list of the toolbar button. After opening the viewer, select archive files to view them (via dragging and dropping or the "Pick ZIP files" button).

Open directly with the browser

Due to the limitation of browser extensions, an assistant tool is required to open an archive file directly.

Using PyWebScrapBook

PyWebScrapBook, available on Windows, Mac OS, Linux, etc., supports viewing an archive file with the provided wsb application.

  1. Install PyWebScrapBook on the platform.
  2. Run which wsb (or where wsb on Windows) from the command line interface to find the path of wsb.
  3. Set default application of MAFF/HTZ file to the application at that path.

Alternative ways and tools

Google Chrome (or Chromium based browsers):

  1. Install WebScrapBook.
  2. Go to the Extensions page. Find WebScrapBook, and check "Allow access to file URLs".
  3. Right-click on a HTZ or MAFF file, and select Google Chrome as the default program.

Firefox on Windows:

  1. Right-click to download a desired command file from below links:
  2. You can optionally install 7-Zip for better support of MAFF.
    • This script opens internal pages which starts with index.html if 7-Zip is installed; and opens only the main internal directory if not installed.
    • This script searches 7-Zip installation at the default path. If it's not installed there, its main directory must be added to PATH environment variable to be invoked correctly.
  3. Right-click on a HTZ or MAFF file, and select the downloaded command file as the default program.

Firefox on Linux Desktop:

  1. Right-click to download the script and launcher files from links below:
  2. Move the script file to ~/.local/bin/ or /usr/local/bin/, and add executable permission.
  3. Move the launcher file to ~/.local/share/applications/ or /usr/share/applications/, and add executable permission.
  4. Set the launcher of HTZ or MAFF file to "Firefox HTZ" or "Firefox MAFF". To do that you can use "Open File With" context menu item of your Desktop Environment (KDE, XFCE, GNOME, MATE etc). Just choose a launcher as a program that you want to use to open a file.

NOTE: For MAFF, currently this only supports opening internal pages which starts with index.html. On some operation systems (Ubuntu, Debian etc) you may need to reboot to let the operation system find a script and a launcher to use them through the "Open File With" context menu or the terminal.

You can perform steps 1-3 by one command

# For maff file type:
sudo wget https://raw.githubusercontent.com/wiki/danny0838/webscrapbook/files/firefox-maff.sh -O /usr/local/bin/firefox-maff.sh && sudo chmod a+rx /usr/local/bin/firefox-maff.sh && sudo wget https://raw.githubusercontent.com/wiki/danny0838/webscrapbook/files/firefox-maff.desktop -O /usr/share/applications/firefox-maff.desktop && sudo chmod a+rx /usr/share/applications/firefox-maff.desktop
# For htz file type:
sudo wget https://raw.githubusercontent.com/wiki/danny0838/webscrapbook/files/firefox-htz.sh -O /usr/local/bin/firefox-htz.sh && sudo chmod a+rx /usr/local/bin/firefox-htz.sh && sudo wget https://raw.githubusercontent.com/wiki/danny0838/webscrapbook/files/firefox-htz.desktop -O /usr/share/applications/firefox-htz.desktop && sudo chmod a+rx /usr/share/applications/firefox-htz.desktop

After that you should reboot your system. After rebooting you can configure your operation system to use Firefox to open .maff (or *.htz). There are two ways to configure file associations in Linux systems. You can configure MIME type (e.g. application/zip) or you can configure file type extension (e.g. *.zip). To open .maff (or *.htz) files in Firefox you need to configure file type extension and connect *.maff (or *.htz) pattern with the launcher (firefox-maff.desktop for maff and firefox-htz.desktop for htz). You can do that in System Setting of your Linux system.

e.g. For KDE 5 (kubuntu) you can type kcmshell5 filetypes to open System Settings/File Associations directly. After that you can peek application item of file type list and create the connection between *.maff (or *.htz) and firefox-maff.desktop (or firefox-htz.desktop).