Skip to content

Commit

Permalink
v1.9 Docs (#713)
Browse files Browse the repository at this point in the history
  • Loading branch information
kblok authored Oct 28, 2018
1 parent 1c7dfcf commit e6bfc38
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 23 deletions.
2 changes: 1 addition & 1 deletion lib/PuppeteerSharp/Page.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,7 @@ await Task.WhenAny(new[]
/// Resets the background color and Viewport after taking Screenshots using BurstMode.
/// </summary>
/// <returns>The burst mode off.</returns>
public Task SetBurstModeOff()
public Task SetBurstModeOffAsync()
{
_screenshotBurstModeOn = false;
if (_screenshotBurstModeOptions != null)
Expand Down
72 changes: 52 additions & 20 deletions lib/PuppeteerSharp/PuppeteerSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<PackOnBuild>true</PackOnBuild>
<PackageVersion>1.8.0</PackageVersion>
<PackageVersion>1.9.0</PackageVersion>
<Authors>Darío Kondratiuk</Authors>
<Owners>Darío Kondratiuk</Owners>
<PackageProjectUrl>https://github.com/kblok/puppeteer-sharp</PackageProjectUrl>
Expand All @@ -13,30 +13,62 @@
<PackageId>PuppeteerSharp</PackageId>
<PackageReleaseNotes><![CDATA[# New Features
* Roll Chromium to r588429.
* Introducing Burst mode.
var screenShotOptions = new ScreenshotOptions
{
FullPage = true,
BurstMode = true
};
await page.GoToAsync("https://www.google.com");
for(var x = 0; x < 100; x++)
{
await page.ScreenshotBase64Async(screenShotOptions);
}
await page.SetBurstModeOffAsync();
# New APIs
* Task<ElementHandle>EvaluateFunctionAsync and Task<JSHandle>EvaluateFunctionAsync.
* BrowserContext.OverridePermissionsAsync.
* BrowserContext. ClearPermissionOverridesAsync.
* Page. SetGeolocationAsync.
* NavigationOptions.Referer.
* Response.RemoteAddress.
* Response.StatusText
* ScreenshotOptions.BurstMode and Page.SetBurstModeOff.
* Browser.Target.
* ConnectOptions/LaunchOptions.Transport and ConnectionOptions/LaunchOptions.EnqueueTransportMessages.
* Frame.GoToAsync
# Changelog
# Breaking Changes
## Evaluate changes
`EvaluateFunctionAsync` and `EvaluateExpressionAsync` won't try to infer the output type when used without generics. It will return a ** JToken** instead.
A piece of code like this:
* Fix null-type bugs.
* Improve PdfOptions documentation.
* Create Request class right away from payload.
* Drop object factory from execution context.
* Page.goto should properly handle historyAPI in beforeunload.
* New ResourceType.Ping.
* Launch with Environment Variables.
]]>
</PackageReleaseNotes>
<ReleaseVersion>1.8.0</ReleaseVersion>
int x = page.EvaluateExpressionAsync("1");
Will need to be replaced by one of these two options:
int x = page.EvaluateExpressionAsync<int>("1");
int x = page.EvaluateExpressionAsync("1").ToObject<int>();
# Changelog
* Bump the version of chromium to 594312.
* Add failing test for page.select.
* Fixed windows fetching.
* Fix description of SecurityDetails class.
* Add zero width element test.
* Add missing configure awaits.
* Fix full page screenshot when defaultViewport is null.
* Unify response tracking in page.goto and waitForNavigation.
* Don't wait for Runtime.Evaluate.
* Browser closing/disconnecting should abort navigations.
* Expect Network.responseReceived event is never dispatched.
* Set JPG background to white when omitBackground option is used.
* Concurrency improvements.
* Check if frame exists before creating a Request.
]]></PackageReleaseNotes>
<ReleaseVersion>1.9.0</ReleaseVersion>
<SynchReleaseVersion>false</SynchReleaseVersion>
</PropertyGroup>
<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion lib/PuppeteerSharp/Response.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ internal Response(
internal TaskCompletionSource<bool> BodyLoadedTaskWrapper { get; }

/// <summary>
/// A <see cref="Frame"/> that initiated this request. Or null if navigating to error pages./>
/// A <see cref="Frame"/> that initiated this request. Or null if navigating to error pages.
/// </summary>
public Frame Frame => Request.Frame;

Expand Down
15 changes: 14 additions & 1 deletion lib/PuppeteerSharp/ScreenshotOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,21 @@ public class ScreenshotOptions
/// <summary>
/// When BurstMode is <c>true</c> the screenshot process will only execute all the screenshot setup actions (background and metrics overrides)
/// before the first screenshot call and it will ignore the reset actions after the screenshoot is taken.
/// <see cref="Page.SetBurstModeOff"/> needs to be called after the last screenshot is taken.
/// <see cref="Page.SetBurstModeOffAsync"/> needs to be called after the last screenshot is taken.
/// </summary>
/// <example><![CDATA[
/// var screenShotOptions = new ScreenshotOptions
/// {
/// FullPage = true,
/// BurstMode = true
/// };
/// await page.GoToAsync("https://www.google.com");
/// for(var x = 0; x < 100; x++)
/// {
/// await page.ScreenshotBase64Async(screenShotOptions);
/// }
/// await page.SetBurstModeOffAsync();
/// ]]></example>
[JsonIgnore]
public bool BurstMode { get; set; } = false;
internal static ScreenshotType? GetScreenshotTypeFromFile(string file)
Expand Down

0 comments on commit e6bfc38

Please sign in to comment.