About file processing in Javascript on Linux

I am developing a browser add-on for Firefox. My addon is designed specifically for working with the Linux platform. How can I process a file in Javascript on Linux? I searched this topic many times, and all I had was file handling in Javascript on Windows using ActiveX objects. Is there a way to do the same in Linux? The type of file I wanted to create and process is just text.

+4
source share
1 answer

The Mozilla Development Center has some really great XPCOM file management components. Check out the documentation for the nsIFile component below:

Reading, writing files: https://developer.mozilla.org/en/Code_snippets/File_I//O#Navigating_with_.0ansIFile

General information about nsIFile: https://developer.mozilla.org/en/Code_snippets/File_I//O#nsIFile_and_path_strings

In short, when developing a Firefox add-on, your JavaScript has special permissions when loading in XUL markup using the "Chrome URL". This JavaScript can read and write to the file system natively for Windows, Mac, and Linux. Thus, there is no need to use Flash or third-party plugins.

+3
source

Source: https://habr.com/ru/post/1336242/


All Articles