Search code examples
google-chromeppapi

In chromium, how to combine --register-pepper-plugins with --launch-and-load-app


I am using chromium command line switch --launch-and-load-app to start a chromium instance that shows only the app that I am developing. This is working well.

Also, I am using --register-pepper-plugins to specify a shared library containing a PPAPI plugin. This too works well, so long as --launch-and-load-app is not specified.

Unfortunately, when the two are combined, instead of the plugin being loaded, only a box appears saying "right-click to play my-plugin.so". Right-clicking does not bring up an option to load the plugin.

How can I cause the plugin to play when using --launch-and-load-app?


Solution

    1. Create a temporary directory to act as chromium's user data directory.

    2. Launch chromium specifying --user-data-dir=<the temp directory>, as well as the appropriate --register-pepper-plugins switch.

    3. Visit a page containing an <embed> that loads your plugin.

    4. Visit chrome://plugins. Find your plugin, and select 'Always allowed to run"

    5. Save a snapshot of the temporary user data directory; it can be used as the data directory to start an instance of chromium in which your plugin will run.