Sparika/Firefox-html-to-epub — Issue #11: problem with directoryEntries
Author: Sparika
Created: 2012-03-09 12:55:53+00:00
State: open

# In browserOverlay.js #

> var wbp = Components.classes['@mozilla.org/embedding/browser/nsWebBrowserPersist;1']
>	.createInstance(Components.interfaces.nsIWebBrowserPersist);
>	wbp.saveDocument(window.content.document, webPageLocal, webFilesLocal, null, wbp.ENCODE_FLAGS_RAW,
> null);
>
> /**
> * Collect files informations
> */
> var array = [];
> if (webFiles.exists()){
>	var entries = webFiles.directoryEntries;

How should it works ?
------------------------------
"entries" should be an iterator containing all files and directories saved in "webFiles".

Bug
-----
Files and directories are correctly saved but only directories are put into "entries" as if they were saved afterwards.

Workaround ?
-------------------
Same problem has been encountered while zipping files. It has been solved by changing the "aQueue" parameter of the "addEntryFile" function from "true" to "false".