MAF
About the MAFF file format
MAFF files are standard ZIP files containing one or more web pages, images, or other downloadable content. Additional information, like the orirginal page address, is saved along with the content; this metadata allows the browser to open these files intelligently.
Features of the MAFF file format
-
Store web content in a single file
The various files required to view a saved page as it appeared on-line are saved together, and cannot be separated by accident.
-
Store multiple independent pages in the same archive
For example, Firefox with the MAF extension is able to save all the open tabs in a single file.
-
Based on the ordinary ZIP / JAR format
The ZIP format is supported natively on many modern operating systems. The contents of MAFF archives can be extracted using any ZIP extractor. The single files that are saved along with the main web page can be easily separated and inspected, in their original form, while preserving the advantages of storing the related content in a single file.
-
View using the jar: protocol
Even without the MAF extension, Mozilla Firefox is able to display the contents of MAFF archives natively, using the jar: protocol.
-
Store metadata about the saved resources
MAFF archives contain metadata like the original URL the page was saved from and the date/time of the save operation. The presence of this additional data is indifferent to ordinary ZIP extractors, but for example allows the Firefox browser with the MAF extension to perform operations like:
- Opening the original page instead of the archived copy while on-line
- Enabling off-line navigation between pages in different archives
- Refreshing the archive contents with the latest on-line version (not implemented in MAF at present)
- Asking web services like the Internet Archive about how the page appeared at the time it was saved (not implemented in MAF at present)
-
Store arbitrary extended metadata
Extended metadata may include the browser's scroll position in the page, text zoom level, and more. The MAF extension for Firefox has an option to store this kind of data, even though the current version is not able to read it.
-
Supported by Open Source products
The MAF extension enables Firefox to handle MAFF archives intelligently. MAF is an Open Source product, released under the GNU General Public License, and as such will continue to remain available in the future.
Status
Full support for the MAFF file format is provided by the following versions of the Mozilla Archive Format extension:
- Version 0.8 and later, for Firefox 3
- Version 0.6.3.1, for Firefox 2 and Mozilla 1.7-1.8
The file format supported by these versions is referred to as MAFF version 1. Previous versions of the MAF extension may not support all the features available in the MAFF file format version 1.
Technical overview
This is not intended to be complete by any means, and is based on the reverse engineering of the existing MAF extension.
File extension and type
MAFF files use the .maff file
extension. Internally, the MAF extension for Firefox registers the MIME type
application/x-maff for files with the
.maff extension, unless there is already
another MIME type association in the system. However, this MIME type is not
advertised outside of Firefox, for example when the file type is registered
with the operating system on Windows.
ZIP implementation
MAF uses nsIZipReader and nsIZipWriter from Mozilla
Firefox. Their implementation is based on
PKWARE's ZIP
Application Note. File and directory names are stored using UTF-8.
Directory structure
The root directory is empty. There is one subdirectory for every saved page. Every subdirectory contains a file named index.rdf, with the metadata, and another file with the main web page that was saved. This file is usually named index, with a file extension based on the content type.
Metadata
Information about the archived files is stored using RDF, an XML format particularly suited to describe metadata about web resources. The matadata is stored using a special MAF XML namespace.
Roadmap
MAFF version 1 is defined on the basis of the existing implementation. As new versions of MAF are released, the description of the file format will be updated, to accomodate the new features. The MAFF format will be extended while ensuring full interoperability between the circulating versions of MAF. This will lead to a more formal definition of MAFF version 2, a superset of MAFF version 1.