Update headless setting for Playwright

This commit is contained in:
Visagan Guruparan 2025-03-10 15:52:43 -05:00
parent a006f6a9c3
commit 7571512e0d
2 changed files with 10 additions and 2 deletions

View file

@ -33,9 +33,13 @@ public class PlaywrightInstance : IDisposable
public async Task<IBrowserContext> 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];
}

View file

@ -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
{