Skip to content

Commit 3a2a395

Browse files
kblokactions-user
andauthored
Fix reuse chrome docs (#2646)
* Fix reuse chrome docs * Docs changes --------- Co-authored-by: GitHub Action <[email protected]>
1 parent 1b22369 commit 3a2a395

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

docfx_project/examples/DownloadFetcher.Download.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ await using (var browser = await Puppeteer.LaunchAsync(new()
5151
Console.WriteLine("Export completed");
5252
}
5353
```
54-
<sup><a href='https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp.Tests/Browsers/Chrome/ChromeDataTests.cs#L14-L49' title='Snippet source file'>snippet source</a> | <a href='#snippet-CustomVersionsExample' title='Start of snippet'>anchor</a></sup>
54+
<sup><a href='https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp.Tests/Browsers/Chrome/ChromeDataTests.cs#L24-L59' title='Snippet source file'>snippet source</a> | <a href='#snippet-CustomVersionsExample' title='Start of snippet'>anchor</a></sup>
5555
<!-- endSnippet -->
5656
```

docfx_project/examples/ReuseChrome.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@ from a location where it was previously downloaded instead of from the default l
1111

1212
Use `BrowserFetcherOptions` to specify the full path for where to download Chrome.
1313

14-
```
14+
<!-- snippet: ReuseChromeExample -->
15+
<a id='snippet-ReuseChromeExample'></a>
16+
```cs
1517
var downloadPath = "/Users/dario/chrome";
1618
var browserFetcherOptions = new BrowserFetcherOptions { Path = downloadPath };
17-
using var browserFetcher = new BrowserFetcher(browserFetcherOptions);
19+
var browserFetcher = new BrowserFetcher(browserFetcherOptions);
1820
var installedBrowser = await browserFetcher.DownloadAsync();
1921
```
22+
<sup><a href='https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp.Tests/Browsers/Chrome/ChromeDataTests.cs#L14-L19' title='Snippet source file'>snippet source</a> | <a href='#snippet-ReuseChromeExample' title='Start of snippet'>anchor</a></sup>
23+
<!-- endSnippet -->
2024

2125
Use `Puppeteer.LaunchAsync()` with `LaunchOptions` with the `LaunchOptions.ExecutablePath` property set to the
2226
fully qualified path to the Chrome executable.

lib/PuppeteerSharp.Tests/Browsers/Chrome/ChromeDataTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ namespace PuppeteerSharp.Tests.Browsers.Chrome
99
{
1010
public class ChromeDataTests
1111
{
12+
public async Task ReuseChromeExample()
13+
{
14+
#region ReuseChromeExample
15+
var downloadPath = "/Users/dario/chrome";
16+
var browserFetcherOptions = new BrowserFetcherOptions { Path = downloadPath };
17+
var browserFetcher = new BrowserFetcher(browserFetcherOptions);
18+
var installedBrowser = await browserFetcher.DownloadAsync();
19+
#endregion
20+
}
21+
1222
public async Task Usage()
1323
{
1424
#region CustomVersionsExample

0 commit comments

Comments
 (0)