title: how to use component.classes in javascript to access local files?
body: <p>I tried a solution to read write a local file in firefox by this function </p>
  
  <pre><code>function Read(file) {
      var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
      var scriptableStream = Components.classes["@mozilla.org/scriptableinputstream;1"].getService(Components.interfaces.nsIScriptableInputStream);
      var channel = ioService.newChannel(file, null, null);
      var input = channel.open();
      scriptableStream.init(input);
      var str = scriptableStream.read(input.available());
      scriptableStream.close();
      input.close();
      return str;
  }
  </code></pre>
  
  <p>but in firefox, execution exited at <code>var ioService=Components.classes["@mozilla.org/network/io-service;1"]</code>. Please tell how to use this code.  Do I need to install any plugins? I am using FF version 23.0.1. I am new to this. Any help will be greatly appreciated.</p>