How to convert a single page webapp into an offline format - javascript

I created a single page application using AngularJS. Is there a way to automatically convert it to an offline format like pdf or chm? The website contains multimedia content such as webms and ideally those should be preserved. Although having a single file (like a chm), would be preferable it would be sufficient to be able to view the contents of the website locally without having to use a web server.
Solutions like saving webpage as MHTML, HTML Help Workshop and WEB to CHM don't generate useful output. Allowing users to download the website and open the files directly doesn't work because of this error.

Related

Secure SCORM content in Offline player

I am developing Desktop Application (which launches a zip containing index.html in browser). I want to secure that zip from end user so that zip's content can not be accessed without App.
NOTE: zip will consist couple of HTML, JS and CSS files and my app will consume it by displaying it's index.html file in browser.
I can encrypt my content but before using/launching content's index.html (through my app in browser) I will have to decrypt and extract zip into local file system. At that time user will get access of decrypted content. Is there any way to somehow keep decrypted content in in-memory from where browser can access HTML file and display them?
The options you have:
one of in-memory filesystems: the simplest and the least useful that answer directly the question "a way to somehow keep decrypted content in in-memory from where browser can access HTML file and display them". If you are going to use a standard browser, the content should be accessible to it, so the user can read it as well.
local web server: no much better, if you keep using standard browser. You can use something like electron's webview or alternative embedded browsers in combination with client certification. This way you can ensure the content is being visible only in legitimate browser. It can be done with nodejs (+ desktop integration) and will protect the content from non-technical users. Anyone with a bit of coding skills will be able to reverse-engineer it tho.
custom web browser: a regular compiled desktop app. You will need to implement your own browser, and can decrypt the archive directly in the app's memory.

Possible download / upload manager embedded on html page with access to local filesystem

As the title indicates i want to have a certain application get access to the local file system. To describe why i will illustrate my situation:
I am a running a IIS WebApplication with the C# MVC 4 Framework as backend module. The site solely consists of HTML, CSS markup and some JS. The page will be loaded in IE11+ (Edge) only. For the standard procedure of displaying and accessing data from as well as sending data to the server this works quite fine.
On a certain page I want the user to be able to upload a file using a simple file dialog, like the one you can initiate with a simple <input type="file"> tag. I also want to offer the posibility to download files from the server but need to know where files has been saved / will be saved to.
As described on a lot of different websites, just like this one here, the HTML5 File API does a great job but will not be able to return the full qualified filename including the local path directions, same for JS accessing the file object.
As my research confirmed HTML5, JS and also SWF (Flash) will not report detailed information because they are all sandboxed applications or restricted by RFCs. I already unterstood and appreciate the effort to secure my trips to internet.
But in this case do need the paths where a file was upload from and the file has been downloaded to.
So my question is, what is the best way to expose the full path directions for a up- as well as downloaded file to report them back to the server?
Is it possible to embed a SWF object inside HTML which will run inside an Adobe AIR sandbox or is a signed JAVA Applet still the one and only solution to accomblish this security breaking task?
A solution i would also apreciate would be the possiblity to ask the user to get access the file system, like you grant access to the web push service to receive notifications.
Also if there is a possible solution which may suite my circumstances please let me know by adding some simeple examples / revealing some factful links, thanks in advance.

Exporting HTML file from Cordova app in a manner that works in both IOS and Android

I have a cordova app which offers a journal function. Users store questions and programmatically generated answers to local storage, which are presented in a rich html page through a Webview.
Some users have asked for the ability to export that file for safekeeping. I want to implement one javascript solution which works in either IOS or Android. So I need a solution that doesn't depend on a local file system (because IOS won't allow that).
I thought about creating an email a user can send to themselves. I could generate a pdf with one of the pdf libraries, but RFC 2368 says I can't attach that as attachments are not allowed in the mailto URL scheme. I can't put html in the body of a mailto email either, RFC 2368 again.
The local storage data is butt-ugly: I don't want to send raw data or JSON strings to an end user, and while I could render a plain-text mailto body, I'd have to lose images and just lay out some very long URLs in plain text and cross fingers that the client will render them as links.
A webview browser page can't be saved.
So what am I missing? What's the single genius solution for taking a web page that exists in local storage and providing the user a way to store it locally on a computer or snag it from a server, regardless of the device or operating system of their phone or tablet?

how to embed a live excel spreadsheet in html

hi i would like to know how i can embed a excel spreadsheet in a web page and change the excel numbers on the hosted file and this in turn automatically changes the webpage sheet?
would like to know if there is a jquery, javascript, css etc code to help me out
for example, book1.xls will be uploaded to the server and index.html will reflect book1.xls as a table in it. when i update book1.xls, it should automatically show in index.html the changed cells.
thanks in advance
The simple way to actually connect to an XLS is through VBScript, but your server will have to support it (which most do).
Another way would be add an ODBC to your servers connectors pointing to your XLS or MDB or whatever Microsoft data file you choose and use JavaScript or any number of languages to connect to it, retrieve data, make changes, etc. The downside is that you must have Administrative rights to the computer hosting the file. You can use a homecomputer to use as server for that file only for instance and link it to your website, but it will affect loading speeds. This will however require you to take a closer look at your home internet security...!!!...but will enable you to make 'live' changes without going to your website. This method is often used for webshops and online catalogues, places where data can change on a daily basis but a database server is undesirable.
The simplest and easiest way is as mentioned before the use of GoogleDocs, but that will require conversion of the document. You won't be using your XLS as datafile. The downside here is that if you make any changes offline (not through the website) the changes will also not be visible, because you'll be editing a completely different file. So you'll need to convert and upload it to GoogleDocs each and every time.
As you can see the method used greatly depends on how often you plan on updating the data, how much traffic you expect and how secure you want it to be.
A "live" spreadsheet can be shown in a web page via an iframe containing a Google Doc spreadsheet. You cut 'n paste the iframe markup from Google Docs and drop it into your web page. The spreadsheet is editable in GDocs. The iframe view can be set to automatically update when the ss is edited.
Perhaps, this is too bland a solution. But it works. I use it all the time.
I doubt you can do that directly from an .xls file, but if you save your Excel file as .csv, you can read a .csv file via jQuery.
There's a plugin here that displays data from a csv file as a table: http://plugins.jquery.com/project/csv2table
The same/similar question is also asked in these posts:
Read Excel data with JQuery
How to parse an excel file in JavaScript?

Open files from a web application with another web application?

So these days we want things to be on the cloud.
In the desktop area we could use one application to create a file, then another to open that file.
I wonder how you accomplish this file sharing between web applications?
Eg. if I create a web application letting the user create a file, how do I share this file to another web application for opening it? Maybe the user created a PDF file on my web application and when he clicks on it, I want this file to be opened using another web application - but is not mine - so that he doesn't need to download it to open it.
Is there a standard way of sharing files between web applications easily?
Im not asking about pure technologies that could make this possible eg. REST/json, but standard specification/implementation for sharing files between applications. Cause I haven't heard of this kind of implementation, which could be good for cloud services to eliminate the need of having to download everything.
Application A assigns an URL to the file, hands the URL over to application B and application B uses HTTP to retrieve the file via the URL. If both applications are running on the same server, this will be just as efficient as reading from a file from the file system, or from a database.

Categories