I have been investigating the possibility to add MHTML multipart/ related support into Mozilla. The main idea behind this is cutting down mobile download times having only a single request instead of several ones. After some researching I came to the following conclusion:
A stream converter can parse the parts of the multipart message and store them into a cache. This is the easy part. Then comes the hard part. I need my own protocol handler to load the resources from cache. If the resource is not in cache I need to wait until the multipart message is fully loaded before trying to load the resource from network. If I were to implement this as an extension, I'd have to re-write all the URIs in the HTML to redirect them to my own protocol handler. UnMHT (https://addons.mozilla.org/en-US/firefox/addon/8051) already does this. The downside is that some Javascript will most likely break. If I don't want re-write the URIs, core changes are needed. I can only think of checking the content type of the root document for each load and if that is multipart/related, then redirect to my protocol handler. Quick search in cross-reference tells me that NS_NewChannel is being called in several places like nsDocShell, nsScriptLoader, nsObjectLoadingContent, CSSLoaderImpl etc. The document and its related resources loading process is very complex. Would there be any central place where to handle the URIs in? Or could anyone think of a centralized way of accomplishing the same result? _______________________________________________ dev-tech-network mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-network
