Skip to content

Commit e6bfc38

Browse files
authored
v1.9 Docs (#713)
1 parent 1c7dfcf commit e6bfc38

File tree

4 files changed

+68
-23
lines changed

4 files changed

+68
-23
lines changed

lib/PuppeteerSharp/Page.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1510,7 +1510,7 @@ await Task.WhenAny(new[]
15101510
/// Resets the background color and Viewport after taking Screenshots using BurstMode.
15111511
/// </summary>
15121512
/// <returns>The burst mode off.</returns>
1513-
public Task SetBurstModeOff()
1513+
public Task SetBurstModeOffAsync()
15141514
{
15151515
_screenshotBurstModeOn = false;
15161516
if (_screenshotBurstModeOptions != null)

lib/PuppeteerSharp/PuppeteerSharp.csproj

Lines changed: 52 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<TargetFramework>netstandard2.0</TargetFramework>
44
<PackOnBuild>true</PackOnBuild>
5-
<PackageVersion>1.8.0</PackageVersion>
5+
<PackageVersion>1.9.0</PackageVersion>
66
<Authors>Darío Kondratiuk</Authors>
77
<Owners>Darío Kondratiuk</Owners>
88
<PackageProjectUrl>https://github.com/kblok/puppeteer-sharp</PackageProjectUrl>
@@ -13,30 +13,62 @@
1313
<PackageId>PuppeteerSharp</PackageId>
1414
<PackageReleaseNotes><![CDATA[# New Features
1515
16-
* Roll Chromium to r588429.
16+
* Introducing Burst mode.
17+
18+
var screenShotOptions = new ScreenshotOptions
19+
{
20+
FullPage = true,
21+
BurstMode = true
22+
};
23+
await page.GoToAsync("https://www.google.com");
24+
for(var x = 0; x < 100; x++)
25+
{
26+
await page.ScreenshotBase64Async(screenShotOptions);
27+
}
28+
await page.SetBurstModeOffAsync();
29+
1730
1831
# New APIs
1932
20-
* Task<ElementHandle>EvaluateFunctionAsync and Task<JSHandle>EvaluateFunctionAsync.
21-
* BrowserContext.OverridePermissionsAsync.
22-
* BrowserContext. ClearPermissionOverridesAsync.
23-
* Page. SetGeolocationAsync.
24-
* NavigationOptions.Referer.
25-
* Response.RemoteAddress.
26-
* Response.StatusText
33+
* ScreenshotOptions.BurstMode and Page.SetBurstModeOff.
34+
* Browser.Target.
35+
* ConnectOptions/LaunchOptions.Transport and ConnectionOptions/LaunchOptions.EnqueueTransportMessages.
36+
* Frame.GoToAsync
2737
28-
# Changelog
38+
# Breaking Changes
39+
40+
## Evaluate changes
41+
42+
`EvaluateFunctionAsync` and `EvaluateExpressionAsync` won't try to infer the output type when used without generics. It will return a ** JToken** instead.
43+
44+
A piece of code like this:
2945
30-
* Fix null-type bugs.
31-
* Improve PdfOptions documentation.
32-
* Create Request class right away from payload.
33-
* Drop object factory from execution context.
34-
* Page.goto should properly handle historyAPI in beforeunload.
35-
* New ResourceType.Ping.
36-
* Launch with Environment Variables.
37-
]]>
38-
</PackageReleaseNotes>
39-
<ReleaseVersion>1.8.0</ReleaseVersion>
46+
int x = page.EvaluateExpressionAsync("1");
47+
48+
49+
Will need to be replaced by one of these two options:
50+
51+
int x = page.EvaluateExpressionAsync<int>("1");
52+
int x = page.EvaluateExpressionAsync("1").ToObject<int>();
53+
54+
# Changelog
55+
56+
* Bump the version of chromium to 594312.
57+
* Add failing test for page.select.
58+
* Fixed windows fetching.
59+
* Fix description of SecurityDetails class.
60+
* Add zero width element test.
61+
* Add missing configure awaits.
62+
* Fix full page screenshot when defaultViewport is null.
63+
* Unify response tracking in page.goto and waitForNavigation.
64+
* Don't wait for Runtime.Evaluate.
65+
* Browser closing/disconnecting should abort navigations.
66+
* Expect Network.responseReceived event is never dispatched.
67+
* Set JPG background to white when omitBackground option is used.
68+
* Concurrency improvements.
69+
* Check if frame exists before creating a Request.
70+
]]></PackageReleaseNotes>
71+
<ReleaseVersion>1.9.0</ReleaseVersion>
4072
<SynchReleaseVersion>false</SynchReleaseVersion>
4173
</PropertyGroup>
4274
<PropertyGroup>

lib/PuppeteerSharp/Response.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ internal Response(
100100
internal TaskCompletionSource<bool> BodyLoadedTaskWrapper { get; }
101101

102102
/// <summary>
103-
/// A <see cref="Frame"/> that initiated this request. Or null if navigating to error pages./>
103+
/// A <see cref="Frame"/> that initiated this request. Or null if navigating to error pages.
104104
/// </summary>
105105
public Frame Frame => Request.Frame;
106106

lib/PuppeteerSharp/ScreenshotOptions.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,21 @@ public class ScreenshotOptions
5252
/// <summary>
5353
/// When BurstMode is <c>true</c> the screenshot process will only execute all the screenshot setup actions (background and metrics overrides)
5454
/// before the first screenshot call and it will ignore the reset actions after the screenshoot is taken.
55-
/// <see cref="Page.SetBurstModeOff"/> needs to be called after the last screenshot is taken.
55+
/// <see cref="Page.SetBurstModeOffAsync"/> needs to be called after the last screenshot is taken.
5656
/// </summary>
57+
/// <example><![CDATA[
58+
/// var screenShotOptions = new ScreenshotOptions
59+
/// {
60+
/// FullPage = true,
61+
/// BurstMode = true
62+
/// };
63+
/// await page.GoToAsync("https://www.google.com");
64+
/// for(var x = 0; x < 100; x++)
65+
/// {
66+
/// await page.ScreenshotBase64Async(screenShotOptions);
67+
/// }
68+
/// await page.SetBurstModeOffAsync();
69+
/// ]]></example>
5770
[JsonIgnore]
5871
public bool BurstMode { get; set; } = false;
5972
internal static ScreenshotType? GetScreenshotTypeFromFile(string file)

0 commit comments

Comments
 (0)