Page 1 of 1

Seeking guidance for hosting a web browser control within shell package

Posted: Tue Mar 23, 2021 2:46 pm
by toddsou
Hi-

I'm targeting SPS SDK 4.3.41.

I see in the SDK there is a class called HtmlBrowser2 control. But I also see in the ..../Select deployment folder that there appears to be evidence of the CefSharp/Chromium library at work behind the scenes.

Is the SDK's HtmlBrowser2 control simply a wrapper around the CefSharp offering ? Does it offer additional value? Can I directly access the underlying CefSharp control through it? ....Or should I simply target the underlying CefSharp libraries directly, bypassing the SPS SDK?

Fyi, I think I might need some js integration capabilities, and I know CefSharp offers this, but not sure if the SPS SDK hides (or enhances??) those features.

Seeking guidance, examples.

Regards,
Todd

Re: Seeking guidance for hosting a web browser control within shell package

Posted: Thu Mar 25, 2021 10:57 am
by BobRichards
I have sent your question to R&D for a response. I'll post it when I get an answer.

Re: Seeking guidance for hosting a web browser control within shell package

Posted: Thu Mar 25, 2021 5:59 pm
by Pradeepa
Hi Todd,

HtmlBrowser2 is a user control that contains the CefSharp's ChromiumWebBrowser control as it's child control, with the following settings on it:

Code: Select all

var settings = new BrowserSettings();
settings.BackgroundColor = (uint)Colors.LightLightBlue.ToArgb();
settings.JavascriptCloseWindows = CefState.Disabled;
CefSharpSettings.LegacyJavascriptBindingEnabled = true;

SPS SDK does not hide any features. Here's a link to the nuget package we use:
https://www.nuget.org/packages/CefSharp.WinForms/71.0.2

I hope this answers your question.

Thanks,
Pradeepa.

Re: Seeking guidance for hosting a web browser control within shell package

Posted: Tue Mar 30, 2021 12:57 pm
by toddsou
Hi Pradeepa-

Yes, upon sitting on a breakpoint, I can see the underlying ChromiumWebBrowser control via HtmlBrowser2's Controls[0] indexer.

But I'm guessing SoftPro/support would frown upon accessing the underlying technology in this way. And also, SoftPro's support for my shell package solution would probably stop with anything I use beyond the SDK's HtmlBrowser2 class. Is that correct?

I think I talked myself into the answer. :-)

Ok, thanks.

-Todd