Building the FireBreath Plugin
Currently, the FireBreath plugin can only be built on Windows (with Mac OS X support in beta); if you are interested in beginning the port to Linux (which should not be too difficult at this point) join the mailing list and make yourself known; we'll help you out!
Requirements
- CMake version 2.8: http://www.cmake.org/cmake/resources/software.html
- Make sure to grab the Binary distribution (cmake-ver-win32-x86.exe)
- When asked, tell the installer to add cmake to your system path
- Visual Studio 2005, 2008 or 2010 (probably could be built on 2003, but that is untested)
- Mercurial: http://mercurial.selenic.com/
Get the source
First thing is first; get the source code. We haven't done any official releases yet (though we should have a windows-only release by the end of January 2010), so you'll have to get the source from Mercurial on google gode.
To get a copy of the source, run the following command:
hg clone https://firebreath.googlecode.com/hg/ firebreath
Generate the example project files
To generate the project files, there are two batch files that can be used:
prep2005.cmd examples
- Generate example project files for Visual Studio 2005prep2008.cmd examples
- Generate example project files for Visual Studio 2008prep2010.cmd examples
- Generate example project files for Visual Studio 2010
The project files will all be generated into the buildex/
directory under the project root.
Generate your own project files
If you have created your own project in the projects/ directory, you can build it by running the same command as for example projects, but (this will be a shocker) without "example".
To generate the project files, there are two batch files that can be used:
prep2005.cmd
- Generate project files for Visual Studio 2005prep2008.cmd
- Generate project files for Visual Studio 2008prep2010.cmd
- Generate project files for Visual Studio 2010
The project files will all be generated into the build/
directory under the project root.
Open the solution
The main solution file for the example projects is buildex/FireBreath.sln
Build and register the DLL
The DLL for the example project will be built in: buildex/bin/Debug/
(replace Debug with the configuration type you use to build)
register this DLL with regsvr32.exe:
regsvr32 npPluginTemplate.dll
Open in your browser and play with it
On firefox, I recommend using FireBug for javascript testing. IE 8 has its own javascript debug tools.
Open the file buildex/projects/FireBreathWin/gen/FBControl.htm
(We'll move this to a better location later)
Most of the links are currently broken; we're working on coming up with a good test plugin and page, but we'll get back to you on it.
Use Jash or firebug (or whatever) to make calls on the plugin. For supported calls, check out projects/TemplatePlugin/MathAPI.cpp
.
A few JS commands to try:
plugin.returnString("This is a test string") "This is a test string"
plugin.intToString(372) "372"
plugin.valid true
Attaching a debugger
To attach a debugger, set breakpoints, etc, first open the project in Visual Studio. Select Debug : Attach to Process, and then select all instances of the browser you are using. (firefox.exe will generally only have one process; iexplore.exe could have many). IE 8 is known to launch sites in different processes sometimes, so if your breakpoint doesn't fire, check to see if a new process has shown up that you need to attach to.
Once you're attached, as soon as you go to the page with the object tag loading the plugin, you should have symbols loaded (assuming it's the debug build) and breakpoints should trigger.
For more debugging tips, see the DebuggingPlugins section