-6

I am wanting to advance my Browser (Google) capabilities to be able to read and write files saved on my PC using Javascript and I am considering using Rhino (because it is discussed in my manual). However, Rhino uses Java to interact with; a language I am not familiar with. I have used C# on a number of occasions and it would appear that the rules for C# are similar in Java.

Before embarking on the 'learning curve' of Rhino and Java, is this a wise choice? At the moment, all I want to do is to open, amend and save files from within a browser on my PC using Javascript. Eventually, I want to pass data from my browser to a program like Frame3DD and to analyse the results; probably by saving the data to external-files.

All help appreciated.

Regards

hemis
  • 45
  • 1
  • 2
  • 11
  • 3
    Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it. – Andrew Stubbs Jul 22 '14 at 10:32

1 Answers1

2

I think you are messing some concepts:

Each browser has a javascript engine to execute code: Chrome uses V8, Firefox uses Gecko, IE uses Trident. There are standalone engines to execute javascript, like Rhino (implemented in Java and included in the Java SE libraries) or Node.js (last one based on V8 engine, extracted from the Chromium project).

You can't change the engine used by a browser. A browser, for security reasons, won't allow you to access to the local file system.

Pablo Lozano
  • 10,122
  • 2
  • 38
  • 59
  • Not entirely true anymore, modern Javascript / HTML 5 does provide certain APIs that allow local file/data access but in a very restricted way (thank god). http://www.w3.org/TR/FileAPI/. But since its all wickedly new, it is of course very much not cross-browser. – Gimby Jul 22 '14 at 12:11
  • 1
    @Gimby Yes, you can access to a file chosen by the user, but you cannot access to a directory or the file system in a general way. That part of the API is "dead":http://www.html5rocks.com/en/tutorials/file/filesystem/ – Pablo Lozano Jul 22 '14 at 12:22