WebPanel final-review fix: truthful browser fallback, focus gate, docs
- Creation-failure fallback sets OpenedInBrowser and says "opened" only when the system browser actually opened; otherwise chat says the browser did not open. Harness check CreateFailureBrowserFails. - FocusPage follows the same in-process foreground rule as SetForegroundWindow (Show and controller creation). Harness check NoFocusFromAnotherProcess; posted-key checks report UNVERIFIED when another process holds the foreground. - PermissionRequested: SavesInProfile = false. - WEB_PANEL.md: allowlist empty-entry rule, GetState -4, AOT renumber caveat, softened focus claim (also in the Changelog). - Formatting: ChatCommandReplyTests brace, /rc layout comment, PluginContract blank line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3f75a9711a
commit
537a40a430
7 changed files with 116 additions and 21 deletions
|
|
@ -24,6 +24,7 @@ public static unsafe class PayloadEntry
|
|||
|
||||
public static void SetEnvironmentDelay(int ms) => _env!.DelayMs = ms;
|
||||
public static void SetBrowserFolder(string? folder) => _env!.BrowserFolder = folder;
|
||||
public static void SetBrowserFails(bool fails) => _env!.BrowserFails = fails;
|
||||
public static void SetWorld(string world) => _env!.World = world;
|
||||
|
||||
/// <summary>The engine's WebPanelApi.Open path: read the caller's struct, then the host.</summary>
|
||||
|
|
@ -109,6 +110,7 @@ public static unsafe class PayloadEntry
|
|||
|
||||
public volatile int DelayMs;
|
||||
public volatile string? BrowserFolder;
|
||||
public volatile bool BrowserFails; // OpenInBrowser returns false without recording a call
|
||||
public volatile string World = "Harness World";
|
||||
|
||||
public IntPtr GameHwnd { get; }
|
||||
|
|
@ -120,6 +122,7 @@ public static unsafe class PayloadEntry
|
|||
public bool OpenInBrowser(string url)
|
||||
{
|
||||
if (!WebPanelUrlPolicy.IsBrowserSafe(url)) { _log("HARNESS: OpenInBrowser got an unsafe url"); return false; }
|
||||
if (BrowserFails) { _log("HARNESS: OpenInBrowser set to fail"); return false; }
|
||||
_browser(url);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue