开发者

Binary files in XUL on different platforms

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开发者_StackOverflow writing different code for different platform, or there is no problem?


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜