Detecting unsupported plugins

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.

Detecting unsupported plugins

Postby megaloni » Mon Jul 20, 2015 1:46 pm

I am trying to find the proper place to add a hook in CEF (or Chromium if need be) to let me know when a page requests an NPAPI plugin (like a Java applet). I'd like to be able to alert the user about the plugin and the problem in a friendly way. I had thought

ContentRendererClient::bool ContentRendererClient::OverrideCreatePlugin(
RenderFrame* render_frame,
blink::WebLocalFrame* frame,
const blink::WebPluginParams& params,
blink::WebPlugin** plugin);

was the proper place but that doesn't seem to be working for me. Any thoughts?
megaloni
Techie
 
Posts: 12
Joined: Tue May 19, 2015 9:18 am

Re: Detecting unsupported plugins

Postby magreenblatt » Mon Jul 20, 2015 2:28 pm

OverrideCreatePlugin is the right place. Look at the Chrome implementation, specifically the logic around plugin placeholders: https://code.google.com/p/chromium/code ... t.cc&l=630
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Detecting unsupported plugins

Postby megaloni » Mon Jul 20, 2015 4:44 pm

Thanks - that did it - just wasn't high enough up in the function for my call to get executed!
megaloni
Techie
 
Posts: 12
Joined: Tue May 19, 2015 9:18 am

Re: Detecting unsupported plugins

Postby edgardog » Mon Feb 01, 2016 4:18 pm

On 2526 (latest at the moment ea9b6c8) the code in OverrideCreatePlugin (libcef/renderer/content_renderer_client.cc) does not seem to work.
I send a message with the orig_mime_type to detect the Java plugin (and take further actions since its not supported anymore) but I stopped getting the message since 2526.
On 2454 this used to work great.

I'm looking at this https://code.google.com/p/chromium/issu ... &start=100
Could that be related?

With the latest changes to 2526, is there a new way of detecting unsupported plugins?

Thanks
edgardog
Expert
 
Posts: 111
Joined: Mon Feb 01, 2016 2:05 pm

Re: Detecting unsupported plugins

Postby edgardog » Wed Feb 03, 2016 3:38 pm

I've also tried to put my code on CreatePlugin (not the override but the actual creation) and also never seems to be called anymore.
This works on 2454.

Did anyone figure out a way of detecting when a page tries to load an NPAPI plugin?
edgardog
Expert
 
Posts: 111
Joined: Mon Feb 01, 2016 2:05 pm

Re: Detecting unsupported plugins

Postby PolesApart » Wed Feb 03, 2016 3:50 pm

Wasn't NPAPI plugins support wiped off entirely of chromium some releases ago?
PolesApart
Mentor
 
Posts: 73
Joined: Fri Dec 05, 2014 1:24 pm

Re: Detecting unsupported plugins

Postby edgardog » Wed Feb 03, 2016 3:55 pm

PolesApart wrote:Wasn't NPAPI plugins support wiped off entirely of chromium some releases ago?


Yes, there is no support for loading an NPAPI plugin. But up to the previous branch, it was possible to OverrideCreatePlugin, detect that it was an NPAPI plugin (useful for detect Java Plugin Content) and deal with the no supported plugin in an elegant way. Basically present the user some info saying the page is trying to use an unsupported Java plugin and that it is no longer supported. Also give the choice to use an older version of the browser that supports the plugin.
I lost that auto-detection with 2526.
edgardog
Expert
 
Posts: 111
Joined: Mon Feb 01, 2016 2:05 pm

Re: Detecting unsupported plugins

Postby magreenblatt » Wed Feb 03, 2016 5:16 pm

Code related to NPAPI plugins has been deleted in Chromium/Blink so probably the load is failing much sooner with newer branches than it did previously. You can dig into the Chromium/Blink code to see if you can find some other trigger. Or you can implement some other approach to identify when a page is attempting to load Java. For example:

- Filtering the HTML code using CefRequestHandler::GetResourceResponseFilter to find plugin object nodes.
- Running JavaScript in the page to detect plugin object nodes.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Detecting unsupported plugins

Postby edgardog » Thu Feb 04, 2016 10:27 am

magreenblatt wrote:Code related to NPAPI plugins has been deleted in Chromium/Blink so probably the load is failing much sooner with newer branches than it did previously. You can dig into the Chromium/Blink code to see if you can find some other trigger. Or you can implement some other approach to identify when a page is attempting to load Java. For example:

- Filtering the HTML code using CefRequestHandler::GetResourceResponseFilter to find plugin object nodes.
- Running JavaScript in the page to detect plugin object nodes.


Thanks for the tips. I'll mess around with GetResourceResponseFilter and see what I can do with it.
edgardog
Expert
 
Posts: 111
Joined: Mon Feb 01, 2016 2:05 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 37 guests