Take the 2-minute tour ×

I want to make a firefox plugin using XUL for making GUI. And I want that my plugin to use binary executeables files. But in different platforms binary executeables files are different, so how does the XUL solve this? I read that XUL is platform-neutral, but I'm not sure that XUL solve this problem itself (but maybe? : ) ). So this problem could be solved by writing different code for different platform, or there is no problem?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

XUL is platform-neutral, binary components are not. The recommended solution starting with Firefox 4 is js-ctypes, this allows you to call into platform's libraries from JavaScript without using any binary code (you still might need several code branches for different platforms). If you really want binary code (XPCOM components or regular executables) in your extension then you need to include multiple files (Windows x86, Windows x64, Linux x86, Linux x64, OS X universal binary). Or you have a different version of your extension for each platform (a number of extensions on addons.mozilla.org do just that).

share|improve this answer
ok, so if I use the last solution, would the difference in XUL code in different versions of extension be big? Or maybe it depends of the binary code? –  Adi Jun 27 '11 at 15:27
@Adi: XUL is merely a user interface description language. What makes it work is JavaScript code. Both should be identical if you distribute different extension versions for different platforms - only the binary component changes. –  Wladimir Palant Jun 27 '11 at 15:30

Your Answer


