I don't know if it is available, but perhaps a look at Microsoft's specification for their "web archive" .mht file format might be helpful. If one is looking at a webpage using Internet Explorer you have the option of saving the whole page as a single file ending with the .mht extension. I certainly wish that Firefox had this capability. Writing an extension for Firefox that provides this capability is on the part of my project list that's labeled "pie in the sky":)...