diff --git a/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightInstance.cs b/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightInstance.cs index 4c65aa32..9f830f2e 100644 --- a/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightInstance.cs +++ b/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightInstance.cs @@ -33,9 +33,13 @@ public class PlaywrightInstance : IDisposable public async Task GetContext(string ctxId) { + var headless = true; +#if DEBUG + headless = false; +#endif if (!_contexts.ContainsKey(ctxId)) { - await InitContext(ctxId, new BrowserActionArgs()); + await InitContext(ctxId, new BrowserActionArgs() { Headless = headless }); } return _contexts[ctxId]; } diff --git a/src/Plugins/BotSharp.Plugin.WebDriver/Functions/OpenBrowserFn.cs b/src/Plugins/BotSharp.Plugin.WebDriver/Functions/OpenBrowserFn.cs index 6a5a1ac1..ed1c7398 100644 --- a/src/Plugins/BotSharp.Plugin.WebDriver/Functions/OpenBrowserFn.cs +++ b/src/Plugins/BotSharp.Plugin.WebDriver/Functions/OpenBrowserFn.cs @@ -29,9 +29,13 @@ public class OpenBrowserFn : IFunctionCallback ContextId = convService.ConversationId, MessageId = message.MessageId }; + var headless = true; +#if DEBUG + headless = false; +#endif var result = await _browser.LaunchBrowser(msgInfo, new BrowserActionArgs { - Headless = false + Headless = headless }); result = await _browser.GoToPage(msgInfo, new PageActionArgs {