1

I have a NPAPI plugin, incorporated into Chrome extension, and defined in manifest file as public. When an object tag with the plugin's mime type is inserted into background page of the extension, the plugin loads ok. When the same object tag is inserted into an arbitrary webpage using chrome.tabs.executeScript, it fails to load. If the plugin itself is placed into Plugins folder (and loaded into the browser), then the objects with the appropriate mime type are inserted into arbitrary web-pages successfully.

The question is why the plugin does not load properly into arbitrary web-page, when it is deployed within the extension and marked as public (so it is supposed to be available for any page, as far as I know).

6
  • does it show up when you navigate to about:plugins?
    – taxilian
    Jan 4, 2012 at 20:25
  • When it is loaded from Plugins folder, it shows up. When it is added as a part of the extension, it does not show up there, but I did not ever see a single plugin from any extension on this page, so I suppose about:plugins is not designed to show such plugins.
    – Stan
    Jan 5, 2012 at 19:29
  • that is not correct; if you install an extension with a public plugin (and everything is installed correctly) then it will show up in about:plugins. Therefore, there is something wrong with your extension/plugin installation. unfortunately, that's all I know
    – taxilian
    Jan 6, 2012 at 4:58
  • Ok, then what is wrong in the line ` "plugins": [{ "path": "npapi.dll", "public": true }],`?
    – Stan
    Jan 6, 2012 at 13:25
  • Plugin works ok when inside the extension and if used on background page, so the only problem that could be if I made a typo in the manifest. But I don't see this.
    – Stan
    Jan 6, 2012 at 13:27

2 Answers 2

2

You should use mark the plugin with "public": true in your extensions’s manifest. The plugin should show up in about:plugins.

If the plugin shows up, confirm that the MIME type and file extensions in about:plugins matches the type of the embed element being injected into the page. Also check to see if other plugins have the same MIME type. If a plugin that is listed earlier has the same MIME type, that plugin will be loaded.

If your plugin doesn’t show up, or it shows up but does not work, you’ve got more detective work to do:

You can start Chrome with the --debug-plugin-loading flag to get extra logging from the plugin infrastructure. Some of these messages look like this:

[24634:-1392008512:1466799063452984:ERROR:plugin_list.cc(358)] Loading plugin /Library/Internet Plug-Ins/Flash Player.plugin

Despite containing the word ERROR, these messages are not errors. ERROR is just the log level. Use Chromium Code Search and the files mentioned in the log (for example plugin_list.cc) to read the log messages in context. Chrome uses a multi-process architecture. So remember that the output might intersperse log messages from different processes.

If you have the source of your plugin, you put logging statements in your plugin code. For example, on OS X you could write:

NPError NP_GetEntryPoints(NPPluginFuncs *pluginFuncs) {
  NSLog(@"FOO NP_GetEntryPoints");
  …

and then

2012-08-20 11:22:56.799 Google Chrome Helper EH[23544:b03] FOO NP_GetEntryPoints

will show up in the log. These log statements can give you further clues about how far plugin loading is getting before it fails.

It will take some effort, but you could build Chromium from scratch and use the --plugin-launcher command line option to get source-level debugging of the plugin loader.

1

Posting an answer with my comment(s) as requested =]

If you install an extension with a public plugin (and everything is installed correctly) then it will show up in about:plugins. Therefore, there is something wrong with your extension/plugin installation. unfortunately, that's all I know.

about:plugins as noted in the comments will display all plugins that are public whether installed as public plugins in an extension or just installed as NPAPI plugins.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.