Hello,

I'm encountering an issue while integrating "DocuWare Platform WebClient" into a WebView2 iframe as part of the development of a Windows Forms (.NET) application.

The purpose of this application is to provide a desktop solution that allows users to launch DocuWare without using a traditional web browser.

Overall, the integration of DocuWare works well, but I am experiencing a problem with the connection to the Desktop Apps.

For example, when I right-click a file and choose Edit, I receive the following message: "Please restart Desktop Apps and try again."

The Desktop Apps are indeed running, since this action works correctly when performed from a regular browser.

Below is my WebView initialization function:



        public async Task InitializeWebViewAsync(string docuWareUrl)
        {
            var env = await CoreWebView2Environment.CreateAsync();
            await WebView.EnsureCoreWebView2Async(env);

            var core = WebView.CoreWebView2;

            core.Settings.IsScriptEnabled               = true;
            core.Settings.IsWebMessageEnabled           = true;
            core.Settings.AreDefaultContextMenusEnabled = true;
            core.Settings.AreDevToolsEnabled            = true;

            core.NewWindowRequested += Core_NewWindowRequested;

            WebView.Source = new Uri(docuWareUrl);
        }


        private void Core_NewWindowRequested(object sender, CoreWebView2NewWindowRequestedEventArgs e)
        {
            var uri = e.Uri;
            if (uri.StartsWith("dwdesktop:", StringComparison.OrdinalIgnoreCase))
            {
                MessageBox.Show($"Open DocuWare Desktop : {uri}",
                                "DocuWare", MessageBoxButtons.OK, MessageBoxIcon.Information);
                try
                {
                    System.Diagnostics.Process.Start(uri);
                    e.Handled = true; 
                }
                catch (Exception ex)
                {
                    MessageBox.Show($"Unable to start DocuWare Desktop : {ex.Message}",
                                    "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

 

Do you have any ideas on how to resolve this issue?

Thank you in advance.