Closed samehissam closed 7 years ago
First of all as we have an applet for the view module so the idea that we worked on is that to search for a way to load the applet viewer module by creating chrome extension that will load the applet in the browser and open the book on it without downloading it.
After searching how to make chrome supports NPAPI again there is the solution to install a chrome extension that called IE tab, that allow you to load applet in chrome but through his search box by typing the url for your page that call the applet
As I mention before that chrome does not support Java Applet so I tried to find a new way to load Djvu content inside chrome browser.
All popular web browser make it very difficult, or even impossible, to use Java applets or plug-ins for viewing DjVu. Readers are forced to download the publication to disk and open them in an external program, which is not very convenient.
How dLibry allow readers to browse DjVu format without installing any additional software?
You can use this project djvu-html5. It is a transfer of the popular Java applet ( http://sourceforge.net/projects/javadjvu/) to the world of JavaScript. As a result, the only thing you need to start viewing DjVu is a web browser supporting HTML5, and it needs to comply with all popular browsers. To implement djvu html5 as plug-in dLibra.
for more information read this article http://fbc.pionier.net.pl/qa/index.php/878/czytelnikom-przegl%C4%85danie-instalacji-dodatkowego-oprogramowania?show=884
But when I tried to open it open chrome unfortunately I got that error XMLHttpRequest cannot load file:///D:/htdocs/f/sample/DjVu_Tech_Primer.djvu. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource. As shown in the following picture
I tried many ways to figure out the problem and I tried some solution like http://stackoverflow.com/questions/4819060/allow-google-chrome-to-use-xmlhttprequest-to-load-a-url-from-a-local-file
But it does not work, then I figure out that the solution in our case is to use server like Xampp. As you can see by visiting this link http://stackoverflow.com/questions/20041656/xmlhttprequest-cannot-load-file-cross-origin-requests-are-only-supported-for-ht
On the other hand it worked perfectly without needing to any servers on Firefox as you can see in the following picture
In my opinion it is not a good way to ask the client to set up server on his computer to use it to solve the chrome issue that I mentioned before.
So I tried to find another solution for that problem without needing to install local server,that is to use a chrome app called web server for chrome
This video explain who to use it https://www.youtube.com/watch?v=3NXoTzISCc0
But I do not know how to solve this problem for the client without asking him to do anything
For the extension I created chrome extension that if you open new tab and push its icon on chrome it will open a specific Djvu document that I provided it in the code
Tasks for extension 1- how to create extension 2- how to load Java Applet using chrome extension 3- how to host the applet on server we will test using localhost 4- how to call the applet from the server 5- how to make chrome know to load the applet and open the book on it without downloading it
Each one should write report here about his task