From cec3d0ea12571fadf56abfca3dfd24635217ae00 Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Sun, 22 Oct 2023 13:00:31 +0800 Subject: [PATCH] 1 --- WebTest/MainWindow.xaml.cs | 2 +- WebTest/WebTest.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WebTest/MainWindow.xaml.cs b/WebTest/MainWindow.xaml.cs index c9ac554..1bfb19b 100644 --- a/WebTest/MainWindow.xaml.cs +++ b/WebTest/MainWindow.xaml.cs @@ -95,7 +95,7 @@ private string registerName = "webContext"; if (args.PermissionKind == CoreWebView2PermissionKind.ClipboardRead) args.State = CoreWebView2PermissionState.Allow; }; - w2m.wb2.CoreWebView2.AddHostObjectToScript(registerName, this.globalContext); + w2m.wb2.CoreWebView2.AddHostObjectToScript("webContext", this.globalContext); }; w2m.Init(); diff --git a/WebTest/WebTest.csproj b/WebTest/WebTest.csproj index f9e32d0..8d4029b 100644 --- a/WebTest/WebTest.csproj +++ b/WebTest/WebTest.csproj @@ -1,7 +1,7 @@  - Exe + WinExe net6.0-windows enable true