Skip to content

Commit 468f849

Browse files
committed
ReadInnerHTMLAsBody option
1 parent 7033ec2 commit 468f849

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/Infrastructure/BotSharp.Abstraction/Browsing/Models/PageActionArgs.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,6 @@ public class PageActionArgs
4343
/// Wait time in seconds after page is opened
4444
/// </summary>
4545
public int WaitTime { get; set; }
46+
47+
public bool ReadInnerHTMLAsBody { get; set; } = false;
4648
}

src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightWebDriver.GoToPage.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,13 @@ await _instance.NewPage(message, enableResponseCallback: args.EnableResponseCall
6767
result.ResponseStatusCode = response.Status;
6868
if (response.Status == 200)
6969
{
70-
// Disable this due to performance issue, some page is too large
71-
// result.Body = await page.InnerHTMLAsync("body");
7270
result.IsSuccess = true;
71+
72+
// Be careful if page is too large, it will cause performance issue
73+
if (args.ReadInnerHTMLAsBody)
74+
{
75+
result.Body = await page.InnerHTMLAsync("body");
76+
}
7377
}
7478
else
7579
{

0 commit comments

Comments
 (0)