Hello!
I'm currently working on a C# addin that needs to load a web page that can interact with solidworks.
I managed to load web pages using CefSharp but when using more advanced functions (javascript bindings) there is a conflict with the Cef process embedded into SW (swCefSubProc). The Cef process can only be loaded once and the one that loads is the basic SW version thus I'm missing some CefSharp functions. I tried running different versions of Cef in my addin (including the one used in SW) with no success.
The only solution I found to solve the conflicts is to remove the cef folder from the SW install directory (not a viable solution).
Using the built in version of Cef could be an option but I can't find any documentation on it.
Has anyone here managed to get a fully functional CefSharp implementation in their addin ? Or any other embedded web browser ?
Best regards,
SW addin and CEF browser
Re: SW addin and CEF browser
Microsoft's WebView2 should do the trick.
Re: SW addin and CEF browser
Thanks for the answer!
I tried WebView2 and it works well.
The only downgrade from CefSharp is the worse object passing from js to c#.
I tried WebView2 and it works well.
The only downgrade from CefSharp is the worse object passing from js to c#.
- AlexLachance
- Posts: 2177
- Joined: Thu Mar 11, 2021 8:14 am
- Location: Quebec
- x 2355
- x 2010
Re: SW addin and CEF browser
I have a macro that creates a BOM, exports it as text and then sends it to the ERP, it opens a Chrome pop-up with all the information to validate and then push into the ERP. Could that have the answer inside it to your need..?vtal wrote: ↑Mon Jul 04, 2022 4:28 am Hello!
I'm currently working on a C# addin that needs to load a web page that can interact with solidworks.
I managed to load web pages using CefSharp but when using more advanced functions (javascript bindings) there is a conflict with the Cef process embedded into SW (swCefSubProc). The Cef process can only be loaded once and the one that loads is the basic SW version thus I'm missing some CefSharp functions. I tried running different versions of Cef in my addin (including the one used in SW) with no success.
The only solution I found to solve the conflicts is to remove the cef folder from the SW install directory (not a viable solution).
Using the built in version of Cef could be an option but I can't find any documentation on it.
Has anyone here managed to get a fully functional CefSharp implementation in their addin ? Or any other embedded web browser ?
Best regards,
Re: SW addin and CEF browser
Maybe, but I managed to implement what I wanted with Webview2, I can now call SW API functions from the browser (by using host objects).
Thanks anyway!
Thanks anyway!