Chromium project advice

I need to make a cross platform desktop app to bypass limitations of iframe. So I will need an embedded WebView/BrowserView.

Does the ServiceStack desktop app support embedding WebView/BrowserView?

Is there any Electron.net ServiceStack project template?

That’s how the app tool works by launching Win32 Desktop App that contains an embedded Windows x64 build CEF (Chromium Embedded Framework) browser.

Whilst the app tool only supports Windows (embedding a CEF build per platform isn’t feasible) the Sharp/Vue Desktop Apps are cross platform in that they can run a headless version of the app with the cross-platform x dotnet tool which launches a headless version of the App (i.e. the dotnet server running) with the OS’s default browser.

If you didn’t need to run C# the obvious solution is to use Electron, but if you did that’s not going to be optimal as it already bundles a node server runtime that is used to render the App, you’d have to bundle it with an additional .NET Server whose lifecycle is tied to the App.

If the headless UX provided by the x dotnet tool isn’t satisfactory the only x-plat solution AFAIK is probably Blazor Desktop App which I assume is due to be released with .NET 6.

Hey Mythz,

Thanks for the reply. I don’t see anyway in your docs to embed another webview inside the app being loaded into CEF component. I think you would need to wrap this method somehow: https://magpcss.org/ceforum/apidocs3/projects/(default)/CefBrowserView.html so it can be called from JS (I am guessing this is what electron does).

I added electron.net to SS react-spa project and it loads front-end fine but the API requests don’t route so I will investigate that to try to figure out why.

The App itself is simply a fullscreen CEF Browser wrapped inside a Win32 App which just loads the home page of the .NET server it also starts.

You can invoke Win32 APIs from JS or C# but it’s not a development environment that allows customizing the Win32 App Shell (other than invoking Win32 commands on it).

If you’ve got it working with Electron that will be the more flexible option.

Yeah, I got it all working smoothly now with electron so it’s all good. Thanks Mythz

1 Like