Skip to end of metadata
Go to start of metadata

Mac browser plugins are bundles, just like regular mac applications. This means you can add resources inside of the bundle; for example you might want to add an image that your plugin will use.

Using CMake to add files to the bundle

In order to add a file to your plugin bundle, you need to let CMake know the file belongs in the bundle. To do this, in your projDef.cmake in your mac directory of your project you should:

1. use the set_source_files_properties CMake command on all the resources you wish to include. An example would be something like:

2. optinally call source_group to group the resources in your project:

3. make sure the file(s) you are going to add are in the SOURCES Cmake variable, BEFORE add_mac_plugin is called.

4. re-run the firebreath mac prep script, and build your project. 

Accessing the contents of your bundle from within your plugin code

Using [NSBundle mainBundle] to try and access your bundle probably won't work, because this will just return the browser's bundle. In order to access the bundle, you need to use [NSBundle bundleWithIdentifier:bundleName], where bundleName as of firebreath 1.5 is com.FBACTIVEX_PROGID. Note: FBACTIVEX_PROGID is currently not available as a preprocessor define in firebreath, but you can add it by altering gen_templates/config.h, and adding a line

Labels
  • None