ariya/phantomjs — pull request #11990 by diosmosis (2014-02-19 03:56:30+00:00)
Title: allow native modules to be created and require()'d

I need to extend phantomjs w/ some C++ code but I don't want to modify phantomjs directly and have to rebuild it constantly (the modifications will be running on travis). So I created this pull request which lets you build and require native modules (ie, shared libraries).

Notes:
- Native modules must end with the .phantom extension and must expose an extern "C" createNativeExtension function that returns a QObject * to expose to JavaScript.
- I don't think the tests will pass on windows. It doesn't seem to be possible to specify a custom prefix when building a shared library w/ qmake. Or at least I can't find a way.

Let me know what you think.