Popup rendering in Cef embedded WPF application

109 views
Skip to first unread message

Ingeniou7

unread,
Mar 27, 2015, 12:03:06 AM3/27/15
to cefs...@googlegroups.com
I have a WPF application that is using CefSharp Web Browser control to load a Web application that I do not own. On the Web application there are validation popups that get triggered upon page validation. In normal browser the popups are rendered appropriately, but the rendering within the CefSharp Web browser control, the popup seems to be inactive and the button ("OK" button) is partially hidden making it diffucult for the user to understand what it is.

Is there anything specific that needs to be done for Popups to be loaded and rendered as expected in CefSharp?

Thanks,

Alex Maitland

unread,
Mar 27, 2015, 3:20:25 AM3/27/15
to cefs...@googlegroups.com

That's not exactly a lot to go by.

- What version are you using?
- When you say popup, do you mean javascript alerts or full browser popups?
- Can you provide a `jsfiddle` to reproduce the problem?
- Does the problem exist when running a different machine?
- Are you using a `DPI > 1`?

The more info you can include the more likely you are to get a helpful response. Have a quick read over https://github.com/cefsharp/CefSharp/blob/master/CONTRIBUTING.md#what-should-i-include-when-creating-an-issue

Ingeniou7

unread,
Mar 27, 2015, 9:32:25 AM3/27/15
to cefs...@googlegroups.com
Alex, Thanks for responding. My answers inline here. I've included a screenshot of how the Alert is getting rendered in my application.


On Friday, 27 March 2015 03:20:25 UTC-4, Alex Maitland wrote:

That's not exactly a lot to go by.

- What version are you using?
I'm using CefSharp v39 
- When you say popup, do you mean javascript alerts or full browser popups?
Its a Javascript Alert 
- Can you provide a `jsfiddle` to reproduce the problem?
I'm afraid I cannot as I don't own the Web application  and don't have the code for it
- Does the problem exist when running a different machine?
Yes 

Alex Maitland

unread,
Mar 27, 2015, 9:43:20 AM3/27/15
to cefs...@googlegroups.com
Without a way to reproduce the issue, my only suggestion would be to program around it. You can implement your own implementation for all `Javascript Dialogs`.

https://github.com/cefsharp/CefSharp/blob/master/CefSharp.Example/JsDialogHandler.cs
https://github.com/cefsharp/CefSharp/blob/master/CefSharp/IWebBrowser.cs#L130

There isn't a while lot of documentation, so you might need to read the source.

Some basics apply though, return false to let `Cef` use it's default implementation, return true to handle yourself. The other params are mostly just strings and bools, so you could be able to work the rest out by trial and error.

Ingeniou7

unread,
Mar 27, 2015, 2:34:39 PM3/27/15
to cefs...@googlegroups.com
I am able to reproduce the problem using the CefSharp.Wpf.Example project.

I opened this link http://www.w3schools.com/js/js_popup.asp and clicked on one of those Buttons that throw an alert window and see the issue. Can you please check to see the behavior?

Thanks,

Alex Maitland

unread,
Mar 27, 2015, 5:57:07 PM3/27/15
to cefs...@googlegroups.com
Can you provide a list of steps to reproduce?

I'm not seeing any problems with any of the examples from w3schools.

Ingeniou7

unread,
Mar 31, 2015, 1:30:37 PM3/31/15
to cefs...@googlegroups.com
Alex, Thanks for being so responsive. Here are the steps with the screenshot.

1. I run the sample WPF project.
2. I load the W3schools link and the click the first "Try it Yourself>>" button.
3. That opens a window within it and on the Result pane, I click the Try it button to see the Alert popup displayed as shown in the attached screenshot.

Thanks,
JavaScriptPopup-CefSharp.gif

Jørn Hansen

unread,
Mar 31, 2015, 8:19:02 PM3/31/15
to cefs...@googlegroups.com
It looks like it's related to https://github.com/cefsharp/CefSharp/issues/777 and this upstream CEF issue https://code.google.com/p/chromiumembedded/issues/detail?id=760

BR,
JornH

Alex Maitland

unread,
Apr 1, 2015, 4:46:08 AM4/1/15
to cefs...@googlegroups.com
This will be fixed for the final release of `39.0.0` or you can try the `MyGet` CI builds using https://www.myget.org/gallery/cefsharp

Ingeniou7

unread,
Apr 1, 2015, 11:53:19 AM4/1/15
to cefs...@googlegroups.com
Thanks Alex. Do you know a date when Version 39.0.0 will be released?

Alex Maitland

unread,
Apr 2, 2015, 5:30:25 AM4/2/15
to cefs...@googlegroups.com
Soon.
Reply all
Reply to author
Forward
0 new messages