Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><i>(please see my note about obfuscation below)</i></p> <p>It might not be the optimal way to develop a Firefox extension, but you can absolutely build them using an external DLL.</p> <p>Before Gecko 2.0 you had to use the rather esoteric Mozilla build toolchain to include compiled code in your extensions.</p> <p>js-ctypes to the rescue:</p> <pre><code>https://developer.mozilla.org/en/js-ctypes/Using_js-ctypes https://developer.mozilla.org/en/js-ctypes/js-ctypes_reference </code></pre> <p>js-ctypes makes very easy work of loading external DLLs and binding their APIs to JavaScript functions. </p> <p>You'll need to compile a few different versions of your DLL, and have your JavaScript correctly detect the platform and load the appropriate DLL, but it basically works the same for all platforms once you're back in JavaScript land.</p> <p><code>ctypes.libraryName</code> helps you determine the extension the DLL has on the current platform (e.g: .dll for windows, .so for Unix). </p> <p>You can use other information (e.g: navigator.userAgent) to more concretely determine which sub-platform (e.g: Windows 7 64bit, or Vista 32bit).</p> <hr> <p><b>Update:</b></p> <p>There are a whole bunch of good reasons to included compiled DLLs in your extensions/applications (e.g: speed, special capabilities, 3rd party libraries), but if your sole purpose is obfuscation (hiding source code), then...</p> <p>I wouldn't worry about it were I you. Technological means of anti-piracy won't get you very far in this modern world - if your software is good enough to get attention, someone <em>will</em> crack it.</p> <p>I'd simply forget about it, and spend a little money on lawyers instead. (Copyright: yay! Patents: nay!)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload