register-pepper-plugins vs. CefAddWebPluginPath

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

register-pepper-plugins vs. CefAddWebPluginPath

Postby jholt » Tue May 24, 2016 3:00 pm

I'm adding functionality to discover and add a set of PPAPI (out of process) plugins on startup.

Currently, I'm adding these with an AppendSwitchWithValue on register-pepper-plugins in ClientAppBrowser::OnBeforeCommandLineProcessing - this appears to be working for a single plugin, but as my future list of plugins may grow fairly large, I'm concerned about running out of command-line string space.

Code: Select all
                       
// This technique works for registering a PPAPI plugin
                        const string x86Path = "C:\\Program Files (x86)\\Path\\To\\My\\Plugin\\Myplugin32.dll";
                        const string mimeType = "application/x-ppapi-myplugin";
                        command_line->AppendSwitch(switches::kPPAPIOutOfProcess);

                        string plugin = x86Path;
                        plugin += ";";
                        plugin += mimeType;
                        CefString cefPlugin(plugin);
                        command_line->AppendSwitchWithValue(switches::kRegisterPepperPlugins, cefPlugin);



I tried the CefAddWebPluginPath/CefRefreshWebPlugins in ClienAppBrowser::OnContextInitialized, however this didn't appear to work, and I'm unclear on how one specifies the MIME type binding for the plugin using this API.
Code: Select all
// This doesn't error, but the test page that works with the above doesn't load the plugin
// How does the MIME type get established via this API?
                        const string x86Path = "C:\\Program Files (x86)\\Path\\To\\My\\Plugin\\Myplugin32.dll";
                        const string mimeType = "application/x-ppapi-myplugin";
                        CefString plugin(x86Path);
                        //CefString plugin(x86Path + ";" + mimeType);  // Is this the right syntax for the arg?  API docs and other forum posts imply it is just path to DLL

                        CefAddWebPluginPath(plugin);
                        CefRefreshWebPlugins();


Am I missing some other registration step? (The plugins are being provided to me as pre-built DLLs - is the MIME type supposed to be encoded/registered in PPAPI DLLs? Is there some way I can review/change these bindings?)
jholt
Techie
 
Posts: 27
Joined: Fri May 02, 2014 4:29 pm

Re: register-pepper-plugins vs. CefAddWebPluginPath

Postby magreenblatt » Tue May 24, 2016 4:42 pm

The CefAddWebPluginPath function is only for NPAPI plugins. It has been removed in newer branches since NPAPI is no longer supported.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: register-pepper-plugins vs. CefAddWebPluginPath

Postby jholt » Tue May 24, 2016 5:00 pm

magreenblatt wrote:The CefAddWebPluginPath function is only for NPAPI plugins. It has been removed in newer branches since NPAPI is no longer supported.


Thanks.

Is there any alternative to specifying PPAPI plugins via --register-pepper-plugins on the command line? I am concerned about command line length if I start specifying many fully-qualified paths to plugins.

Is the whole family of Cef*WebPlugin* methods specific to NPAPI only?
I can compile/call them with no warnings, and still see them in the apidocs3/ in 3.2526 (Windows, 32-bit)
jholt
Techie
 
Posts: 27
Joined: Fri May 02, 2014 4:29 pm

Re: register-pepper-plugins vs. CefAddWebPluginPath

Postby magreenblatt » Tue May 24, 2016 6:48 pm

jholt wrote:Is there any alternative to specifying PPAPI plugins via --register-pepper-plugins on the command line?

Not currently.

jholt wrote:I am concerned about command line length if I start specifying many fully-qualified paths to plugins.

Are you writing these plugins yourself? If not, Flash is the only one I'm aware of that would be generally useful.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: register-pepper-plugins vs. CefAddWebPluginPath

Postby jholt » Tue May 24, 2016 9:47 pm

magreenblatt wrote:\
jholt wrote:I am concerned about command line length if I start specifying many fully-qualified paths to plugins.

Are you writing these plugins yourself? If not, Flash is the only one I'm aware of that would be generally useful.


Correct - we have our own (versioned) plugin(s), which our suite of web apps can use when hosted in our CEF client. I need to register all released versions of the plugin(s) to be potentially available at startup, since the user may potentially run any web app (which can use any version.)

Initially this won't be a problem (as this is plugin #1, version 1.0), but the list of plugins will grow over time, such that the final string could overflow the windows command line limit (which could be anywhere from ~2k to 32k, depending on how it's being handled)
jholt
Techie
 
Posts: 27
Joined: Fri May 02, 2014 4:29 pm

Re: register-pepper-plugins vs. CefAddWebPluginPath

Postby magreenblatt » Tue May 24, 2016 9:53 pm

Why not create and register a single bootstrap plugin that then loads the functionality for the requested version?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: register-pepper-plugins vs. CefAddWebPluginPath

Postby jholt » Tue May 24, 2016 10:09 pm

Great suggestion - thanks for the help!
jholt
Techie
 
Posts: 27
Joined: Fri May 02, 2014 4:29 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 44 guests