Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free.

I'd like to write an application that would use both Javascript and HTML as for the user interface. The app wouldn't really need an internet connection but will need access to the user's local files.

My first thought was that this would be impossible in a browser due to the security restrictions on the access to local files.

My second thought was to try to use webkit directly from C++ and use Python instead of Javascript, but that seems rather complicated, and I feel like overkilling by using Qt.

My third thought was to use a signed Java applet to make all local accesses, but then I'm not too sure of this either.

Any suggestions on what I should do?

share|improve this question
1  
Have you ever seen TiddlyWiki? –  Pointy Jan 28 '11 at 21:36

6 Answers 6

up vote 6 down vote accepted

I'll admit that I know very little about this, but it sounds like what you're after is what XUL provides.

From the homepage:

XUL (XML User Interface Language) is Mozilla's XML-based language that lets you build feature-rich cross platform applications that can run connected or disconnected from the Internet.

...

Web developers already familiar with Dynamic HTML (DHTML) will learn XUL quickly and can start building applications right away.

Regarding filesystem access: https://developer.mozilla.org/en/Code_snippets/File_I//O

This article describes local file input/output in chrome JavaScript.

You access the file system using Mozilla XPCOM components. A list of resources and interfaces for local I/O is available for both Files and Streams at XUL Planet.

Because of my lack of familiarity, I'll leave it up to the community to decide whether or not this answer has merit.

EDIT: Making this answer a community wiki since I don't have much real information to offer.

share|improve this answer
1  
This looks quite interesting, I'll take a look. –  Manux Jan 28 '11 at 21:47
1  
Haven't tried this myself yet, but providing a XUL application with a browser view (like XUL Webapp Wrapper) is a good start, then you can probably use XUL's message manager to set-up communication between the Javascript and the XUL application (in where XPCOM components can be accessed) –  Motin Mar 8 '13 at 17:16

You can always install needed servers locally and access user's local files that way.

I have been using Server2Go and MAMP

share|improve this answer

You could - for example - use Cappuccino: It allows you to build Applications in Objective-J (a language written in JavaScript) and run them either in the browser or as a Desktop application with local file access .

Then there is Adobe AIR, which allows you to write apps in JavaScript/HTML and access the file system.

Or you could use the new File Access API: http://hacks.mozilla.org/2009/12/w3c-fileapi-in-firefox-3-6/ (it has big restrictions, though: HTML 5 File API)

JavaScript is a beautiful language! Please update this question with information on which route you choose.

share|improve this answer
    
I'll look at the first 2. The HTML5 File API can only access files selected by the user; in my current position this would be quite annoying to do because of the quantity of files. –  Manux Jan 28 '11 at 21:48
    
I see. Cappuccino is a great framework and has a very active community. I'd definitely strongly suggest that route over Adobe AIR. –  Johannes Fahrenkrug Jan 28 '11 at 21:52

If you're not a Microsoft basher and/or don't mind being bound to IE, a Hypertext Terminal Application (HTA) is another option. I once (long ago) create a complete and pretty large stand alone database-application using HTA.

share|improve this answer

Do you know PHP? I suggest you to install Wamp or phpTriad or something similar for Windows. That way you can reach to the local files. If it is Linux most of the *nix based operating systems have build in Apache and PHP..

share|improve this answer

Mozilla currently develops Chromeless, which seems to be able to do exactly what you want and has filesystem access

share|improve this answer
    
Unfortunately, Chromeless project is considered inactive and have no commits for more then 2 years. –  Meglio Mar 2 '13 at 14:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.