HTML/Javascript/CSS Desktop Applications - javascript

I have written a program in HTML, Javascript and CSS, and I am displaying it in IE. I'm dependent on IE because data is written to, and read from an Excel File and I need to use ADO for that.
However, the "An activex object is trying to interact with oter parts of the page..." prompt is very irritating, seeing as it is an application that will be store locally on the user's computer, and will not be a web application. I find HTA difficult to debug and it seems as though it hasnt been updated in a while. I can't add my application to trusted sites and use custom level to deal with the activex prompt because it is stored on my computer. I was thinking on storing it on my local host, as I would then be able to add it to trusted site, but this would require adjustments to the user's computer.
Ao my question is, what is the best way for me to display my html/javascript/css program, as a desktop application, with little or no need to change any settings on the user's computer, that could read/write to and from excel spreadsheets (or if you know a better way of dealing with this data), and is stores on the user's couter rather than as a web application?
Any advice would be greatly appreciated:)

Write a windows application instead and use the Apis of excel. Your model of HTML CSS js will not work well with security.

Related

Is it possible to using web api and open a local folder? [duplicate]

We are currently looking at porting a enterprise silverlight application over to html5. The major roadblock that we have hit is the ability to open files from the user's local disk. Currently they have a document library which just links to files on their computer that they can open from within the app and view or print out. All that I read is that you can only access the local sandbox of the web app with the html5 file api's. We want to load these files from code.
Does anyone know of any workarounds to this?
Thanks
There is no way for html5 to access local file without user selection. But FSO: FileSystemObject works for IE and MAYBE could be regarded as a work around. But still there are some requirements to meet.
It is possible to use chrome's filesystem API to access files on a users local filesytem. So you'd have to be willing to make this a chrome only application.
Using java you can create a "Signed" applet which has access to the local filesystem. (if the applet is signed you can request filesystm permissions)
then there is a tutorial for accessing methods of your java code directly from javascript here: http://docs.oracle.com/javase/tutorial/deployment/applet/invokingAppletMethodsFromJavaScript.html
you should be able to perform something similar from silverlight.
There is no workaround in pure HTML5/Javascript. You need the use of plugins, such as Java or Silverlight (maybe you shouldn't port it after all). As for workarounds, HTML5 gives you an easy way drag and drop multiple files that you could transfer on the server and then display back to your users. Another workaround would be to install a custom agent (a software with only a tray icon) that would send the information about the current user "document library" to server and then again, you could display it back to the user.
Note: I've heard somewhere that browsers will eventually stop supporting plugins. http://www.howtogeek.com/179213/why-browser-plug-ins-are-going-away-and-whats-replacing-them/
Ya, I agree with Markain. However, if you were to limit your audience solely to chrome users, I daresay, you would most likely use some of your users. If Huazhihao is right, then your number of leaving customers should decrease but users who regularly use firefox won't be happy. Overall, I think that this will not work. Otherwise, there would be too many websites that trashed your hard driver (or at least wherever you have the rights to edit/delete files). I think it would be best if your product was setup to synchronize the file whenever an internet connection was detected and a change was made to the file. That way the user would not need to visit the website whenever the file was uploaded. If this is some kind of an error file, then it would be most beneficial if you were to make a link in the application that when clicked, would upload the file to the website and the website were to do whatever was necessary. If this is a purely online thing, then I don't see what business you would have looking through other peoples' files =-). Hope I helped!

Microsoft Javascript Add-In: read/write to Excel, Access

I am trying to create a Microsoft Word Add in. I would like the javascript Add in to have the ability to read and write to Microsoft Access and Microsoft Excel files. This is trivial with VBA, but I do not want to divide up the user experience between my Javascript add in and a VBA button in the original Word document. I would like to be able to read and write from the Javascript add in somehow.
I know I have access to things like Word.run(function (context) {..... from the docs, but example functions have nothing to do with accessing other documents.
What is the right way to access other Microsoft documents from a Javascript add in to read and write?
Thanks.
By "other Microsoft documents" I'll assume you are talking about any related files the user has stored on their PC. But these JavaScript for Office add-ins are essentially just web pages running in an embedded browser, and applications running in a browser are sandboxed and just don't have access to the local computer (without installing client helper applications).
So your app will need to prompt the user to upload a file to your web server where you can interact with the file using a relevant API (which would be a completely different topic). Or you can use web-based APIs to interact with web-based file systems (OneDrive/Graph, Dropbox, etc.).

How to search the Local file system of Windows using Javascript?

Operating system : Windows 8.
Input-from : A text field from a html page .
Input-type: text.
Output : the file that was searched.
What I want : I want the user to enter some keywords and have JavaScript search the user's local files...
Is there any way? or A javascript Library?....
And how I can query the file system about the files using Javascript..in Windows..
EDIT::
Thanks everyone for the reply...
The way I get it is ,either I have to develop my own browser based in Java that has sufficient permissions.. or
I would have to implement a file crawler that indexes everything that sends that file to the a server , so that javascript can then access it through xmlhttp requests to the server ....
This was just a curiosity and I don't want to expose anyone's personal files on the Internet.
A fun project.. That all tinkered in my mind.
This is not possible from a web page because of the browser's security restrictions. You could access the local file system with Node.js or an Electron app, but I don't know if that would suit your use case
No. That's simply not possible and even if it is, it should not be used, as it would make one's local file system open to various threats because you are directly exposing your machine on the internet. That's sufficient enough reason for a webapp not to access one's local file system in any manner whatsoever.
P.S: If you really want it, There are a few third party libraries which use Sandboxed file systems. You can try that if you want.
I havent tried it personally, but found the below link via quick googling so i am not sure if its officially supported up until now.
https://www.html5rocks.com/en/tutorials/file/filesystem/
Use <input type="file">, which implements ability for user to select file from local filesystem.

Javascript access desktop application

I'd like you to give a tip for my issue. I'm pretty new to javascript so I don't have such overview.
I have a desktop application - it's basically a storega for data (+ some GUI). And there's a set of Javascript files, which are ment to get data from desktop application.
These javascript files runs in every browser - for each browser I've made a extension wrapper. There is also a testing java-webkit browser, which injects these files directly (so no extension's API).
So I need to create communication API between Javascript and desktop application, which is able to run in every environment (browser-specific implementation would be too "expensive" to maintain).
So I was thinking of sockets. But there is only Websocket protocol support in javascript. Client looks simple, but I'm afraid that server-side would require too much work and dependecies.
Could you give me a tip, for other technologies, which compatible with my requirments?
And second question - to the sockets - would it be even possible to access socket on "localhost:port" from these's javascript files, when they are Content scripts running in page's context?
Thank you for advice.
Sockets is the way to do it. #Luckyrat has provided some code on how to do it from a Firefox Addon:
https://stackoverflow.com/a/17459064/3791822

Accessing local file system on browser

Please hear me out before you start crying security issues.
This is for an intranet application, hence I have full range to install any plugins or change any security permissions to suit.
What I want is for them to go to a webpage and click a link to download a file, such as a Word Document. This gets transferred to local storage of some kind (sandboxed if need be) and then is opened in word as a regular file.
When they click save, JavaScript or something will pickup the file is saved or the program is no longer accessing it and can be actioned upon, such as uploading back up to the server.
Is there any way to do this. I have looked at IndexedDb, WebStorage, HTML5 FileSystem API but I am new to all and don't see a way to do this.
I am open to coding any needed plugins as long as you don't mention Flash. The main issue I am coming across is opening a file downloaded into some form of local browser and then opening it via a desktop application, e.g. Word.
Any help, greatly appreciated.
After much research the only way to do it is with a plugin. IndexedDB, FileSystem API or WebStorage can not access the local file system. Which is good.
Silverlight is a good option for intranet and .NET, which is what I have chosen to go with.
Silverlight 5 in full permissions with a file watcher. The file watcher can be accomplished with this method: Is there an alternative to accomplishing what the FileSystemWatcher does in Silverlight?

Categories

Resources