Avalonia application with Webview can be deploy to Browser version? #15519
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
It's not technically possible to include any kind of WebView in the Browser. |
Beta Was this translation helpful? Give feedback.
-
It does not really make sense to embed a web browser in a web browser. iframe is the most simple approach you can do here, but you will run into the same limitations no matter what you do due to how restricted web assembly is. CORS is a pain to deal with but also necessary. The only real generic work around would be to proxy everything from server hosted on the same domain as your site, and then that can serve your app. But depending on what you are doing, may be a very terrible idea. |
Beta Was this translation helpful? Give feedback.
There is a sample here for creating an iframe, no idea how well it works as I have not tried it.
https://github.com/AvaloniaUI/Avalonia/blob/master/samples/ControlCatalog.Browser/EmbedSample.Browser.cs
You will also need this code:
Avalonia/samples/ControlCatalog/Pages/NativeEmbedPage.xaml.cs
Lines 56 to 86 in 06b3434