sparika / firefox-html-to-epub Goto Github PK
View Code? Open in Web Editor NEWAjout d'une extension qui permet d'enregistrer une page web au format epub
Ajout d'une extension qui permet d'enregistrer une page web au format epub
Epub validator http://validator.idpf.org/application/validate return an unknown error
Extra field length for first filename must be 0, but was 9 !
*Fully translated application
*Minimum support: french and english
container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container"
xml namespace missing. This cause an error in EPUB Validator http://validator.idpf.org/application/validate
The extension has not yet been tested on another platform than ubunu.
We should test it under Windows, Mac and Android.
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;
"entries" should be an iterator containing all files and directories saved in "webFiles".
Files and directories are correctly saved but only directories are put into "entries" as if "files" were saved afterwards.
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".
When we use "save as" in firefox, the saved page is added to the download manager. This indicate that the task has been completed. This is how it should work in our extension.
Daniel Glazman has put together a few notes on how you can improve the result, for a future version: http://www.glazman.org/weblog/dotclear/index.php?post/2012/02/27/Save-as-EPUB
If you don't know who Daniel Glazman is, feel free to google him :)
Incorporate the entry Save as EPUB into Save Page As... where user would select EPUB File from the already available drop-down menu.
When the user choose a file name for his epub, ou code append ".epub" to it. This should only be done if the user has given a file name without ".epub" extension.
Reference file from OEPBS/Files in content.opf
http://www.ibm.com/developerworks/xml/tutorials/x-epubtut/section3.html
Epubs generated by our plugin seems to be uncompatible with Fbreader, Adobe Digital (but not tested) and Reader for PC (but not tested).
When FBReader open one of our epub, there is a progress bar wich complete its loading and then nothing. Firefox's EPUBReader can read the same file without problem.
The epub file (zip file) doesn't contains "webpage.html" and other files form the "Files" directory. This is propably a synchronization problem.
We should find an icon for our extension.
This icon should be compliant with MPL 2.0.
Here is the official EPUB icon. (proprietary?)
http://upload.wikimedia.org/wikipedia/en/thumb/1/14/EPUB_logo.svg/160px-EPUB_logo.svg.png
Once the add-on is usable, submit it to http://addons.mozilla.org .
Each Epub should be identified by a unique URI
dc:titleHello World: My First EPUB/dc:title dc:creatorMy Name/dc:creator urn:uuid:12345/dc:identifier http://www.ibm.com/developerworks/xml/tutorials/x-epubtut/section3.htmlWe should also use this URI to identify the temporary directory we are working in.
For now it's "Tmp_D/FHTE" it should be "Tmp_D/FHTE_URI12345" or something like that.
You should add:
LICENSE
, at the toplevel of the git, with the license of this project;See for instance http://www.mozilla.org/MPL/boilerplate-1.1/
mimetype should be added first to the epub file (zip file) and shouldn't be compressed.
You should create a file called AUTHORS
, listing all the authors of this add-on. This file should be at the toplevel of the git.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.