WebPanelHost (CoreCLR engine only): one unowned WS_POPUP over the game client area on its own STA thread and GetMessage loop, lifted from the 2026-11-07 spike's popup-free path. Open/Navigate/Close/GetState never block: they validate, update the caller-visible state under a lock, queue work and post WM_APP+1 to the host window. WebView2Loader.dll is loaded by full path from the shim's Runtime folder; the runtime probe on the panel thread decides RuntimeMissing, any later creation failure is CreateFailed. Navigation guard (NavigationStarting incl. redirects, NewWindowRequested, LaunchingExternalUriScheme): off-list http/https goes to the system browser, anything else is dropped; logs carry only Redact()ed URLs or hosts. Escape via AcceleratorKeyPressed unless PageKeepsEscape. Visibility by the PID rule on a 50 ms timer plus a foreground WinEvent; raises only when below the game; layout remembered in layout.json. Shutdown unhooks, closes the controller, destroys the window and unregisters the class before the collectible context unloads. WebPanelNativeArgs copies every string out of the caller's (stack or pooled) buffers before anything is queued. WebPanelApi is the ABI glue (AOT keeps the Unavailable stub). engine.json "WebPanel" (default true) is the kill switch. EngineLifecycle shuts the panel down after EndSceneHook.Uninstall. The WebView2 package's WinForms/WPF references are dropped before reference resolution. Deviations from the brief: IWebPanelEnvironment gains BrowserExecutableFolderForTests (the harness forces a creation failure with it) and is excluded from the AOT build with the host; Show only takes the foreground when it is already in this process (or none). tools\WebPanelHarness (x86 exe) + tools\WebPanelHarness.Payload: fake game thread, fake 16 ms pump, collectible context mirroring EngineLoadContext, local virtual hosts, posted input only. 17 ok, 0 FAIL, 4 UNVERIFIED offline (Escape via posted input never raises AcceleratorKeyPressed; visibility needs the foreground): owner in-game checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
51 lines
2.9 KiB
XML
51 lines
2.9 KiB
XML
<Project Sdk="Microsoft.NET.Sdk">
|
|
|
|
<!--
|
|
The web panel host under test, as the CoreCLR engine compiles it: src\RynthCore.Engine\WebPanel\*.cs
|
|
(host, Win32 interop, policies, layout store, ABI argument reader) and the ABI structs from
|
|
Plugins\PluginContract.cs, plus a stub environment (PayloadEntry.cs). tools\WebPanelHarness loads this
|
|
DLL into a collectible AssemblyLoadContext that mirrors the shim's EngineLoadContext, drives it, and
|
|
checks the context unloads. Not a test project on its own (no "Test" in the name: Run-AllTests skips it).
|
|
-->
|
|
<PropertyGroup>
|
|
<TargetFramework>net10.0-windows</TargetFramework>
|
|
<PlatformTarget>x86</PlatformTarget>
|
|
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
|
|
<SelfContained>false</SelfContained>
|
|
<OutputType>Library</OutputType>
|
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
<Nullable>enable</Nullable>
|
|
<InvariantGlobalization>true</InvariantGlobalization>
|
|
<RootNamespace>RynthCore.Engine.WebPanel</RootNamespace>
|
|
<AssemblyName>WebPanelHarness.Payload</AssemblyName>
|
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
|
<WebView2UseWinRT>false</WebView2UseWinRT>
|
|
<WebView2LoaderPreference>Dynamic</WebView2LoaderPreference>
|
|
<GenerateDependencyFile>false</GenerateDependencyFile>
|
|
<NoWarn>$(NoWarn);CS0649;CS0169</NoWarn>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2903.40" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<Compile Include="..\..\src\RynthCore.Engine\Plugins\PluginContract.cs" Link="Engine\PluginContract.cs" />
|
|
<Compile Include="..\..\src\RynthCore.Engine\WebPanel\WebPanelUrlPolicy.cs" Link="Engine\WebPanelUrlPolicy.cs" />
|
|
<Compile Include="..\..\src\RynthCore.Engine\WebPanel\WebPanelWindowPolicy.cs" Link="Engine\WebPanelWindowPolicy.cs" />
|
|
<Compile Include="..\..\src\RynthCore.Engine\WebPanel\WebPanelProfile.cs" Link="Engine\WebPanelProfile.cs" />
|
|
<Compile Include="..\..\src\RynthCore.Engine\WebPanel\WebPanelNativeArgs.cs" Link="Engine\WebPanelNativeArgs.cs" />
|
|
<Compile Include="..\..\src\RynthCore.Engine\WebPanel\WebPanelLayoutStore.cs" Link="Engine\WebPanelLayoutStore.cs" />
|
|
<Compile Include="..\..\src\RynthCore.Engine\WebPanel\IWebPanelEnvironment.cs" Link="Engine\IWebPanelEnvironment.cs" />
|
|
<Compile Include="..\..\src\RynthCore.Engine\WebPanel\WebPanelNative.cs" Link="Engine\WebPanelNative.cs" />
|
|
<Compile Include="..\..\src\RynthCore.Engine\WebPanel\WebPanelHost.cs" Link="Engine\WebPanelHost.cs" />
|
|
</ItemGroup>
|
|
|
|
<!-- As the engine: no WinForms/WPF controls (RynthCore.Engine.csproj DropWebView2UiAssemblies). -->
|
|
<Target Name="DropWebView2UiAssemblies" BeforeTargets="ResolveAssemblyReferences">
|
|
<ItemGroup>
|
|
<Reference Remove="@(Reference)" Condition="'%(Filename)' == 'Microsoft.Web.WebView2.WinForms' Or '%(Filename)' == 'Microsoft.Web.WebView2.Wpf'" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
</Project>
|