title: Integrating a c++ library (.dll and .lib files) into a CFX based Firefox Plugin so that all code interacts on the browser or client computer.
body: <p>Introduction: </p>
  
  <p>I am building a plugin for Firefox version 31.5.0 using the cfx tool. I have been provided with a C++ SDK with header files, .dll files and a .lib file. For this application, I cannot run any scripts or programs on the server, so all code has to work on the client side. Is it possible to integrate this library into my Firefox Plugin (coded mostly in Javascript) such that everything runs on the client side?</p>
  
  <p>Conditions: </p>
  
  <ol>
  <li><p>I know this isn't the best way to go about developing a web plugin, but it is a requirement I'm faced with. I cannot run anything server side. </p></li>
  <li><p>Emscripten is a tool I've heard about to convert C++ code to Javascript. For those who have used this tool, are there any deficits in functionality of the code (or even bugs) that arise when converting large libraries to Javascript?</p></li>
  <li><p>I do not have access to the original source code of the library and thus cannot rewrite it myself in Javascript. </p></li>
  </ol>
  
  <p>Further Details: </p>
  
  <ul>
  <li>The C++ Library will be used to perform encryption and decryption as  well as contact a server for information. Note: The library itself must be executed on the client side. </li>
  <li>If C++ isn't viable, I have the option of using JNI to call C++ from a java wrapper application. Is there a way to execute Java code from the client side via the browser?</li>
  </ul>
  
  <p>I apologize for lack of source code. I'm still at the planning stage of this project and I've been tearing my hair out trying to find a solution that fits the criteria. </p>