Update headless setting for Playwright
This commit is contained in:
parent
a006f6a9c3
commit
7571512e0d
|
|
@ -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];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue