Skip to content

Commit 78e2cf3

Browse files
authored
Merge pull request #2734 from hardkoded/rename-product-to-browser
Rename product to browser
2 parents 9fff3c0 + bb9ee34 commit 78e2cf3

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

.github/workflows/dotnet.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
- name: Test (Linux)
9292
if: matrix.os == 'ubuntu-latest'
9393
env:
94-
PRODUCT: ${{ matrix.browser }}
94+
BROWSER: ${{ matrix.browser }}
9595
HEADLESS_MODE: ${{ matrix.mode }}
9696
run: |
9797
Xvfb :1 -screen 5 1024x768x8 &
@@ -101,7 +101,7 @@ jobs:
101101
- name: Test (Windows)
102102
if: matrix.os == 'windows-latest'
103103
env:
104-
PRODUCT: ${{ matrix.browser }}
104+
BROWSER: ${{ matrix.browser }}
105105
HEADLESS_MODE: ${{ matrix.mode }}
106106
run: |
107107
cd .\lib\PuppeteerSharp.Tests

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ await using var page = await browser.NewPageAsync();
6060
await page.GoToAsync("http://www.google.com");
6161
await page.ScreenshotAsync(outputFile);
6262
```
63-
<sup><a href='https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp.Tests/ScreenshotTests/PageScreenshotTests.cs#L53-L61' title='Snippet source file'>snippet source</a> | <a href='#snippet-ScreenshotAsync' title='Start of snippet'>anchor</a></sup>
63+
<sup><a href='https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp.Tests/ScreenshotTests/PageScreenshotTests.cs#L54-L62' title='Snippet source file'>snippet source</a> | <a href='#snippet-ScreenshotAsync' title='Start of snippet'>anchor</a></sup>
6464
<!-- endSnippet -->
6565

6666
You can also change the view port before generating the screenshot

lib/PuppeteerSharp.Nunit/PuppeteerTestAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class PuppeteerTestAttribute : NUnitAttribute, IApplyToTest
2020
{
2121
private static TestExpectation[] _localExpectations;
2222
private static TestExpectation[] _upstreamExpectations;
23-
public static readonly bool IsChrome = Environment.GetEnvironmentVariable("PRODUCT") != "FIREFOX";
23+
public static readonly bool IsChrome = Environment.GetEnvironmentVariable("BROWSER") != "FIREFOX";
2424
// TODO: Change implementation when we implement Webdriver Bidi
2525
public static readonly bool IsCdp = true;
2626
public static readonly HeadlessMode Headless =

lib/PuppeteerSharp/BrowserFetcher.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ internal static string GetBrowsersLocation()
206206
return assemblyDirectory.FullName;
207207
}
208208

209-
private static string GetDownloadURL(SupportedBrowser product, Platform platform, string baseUrl, string buildId)
210-
=> _downloadsUrl[product](platform, buildId, baseUrl);
209+
private static string GetDownloadURL(SupportedBrowser browser, Platform platform, string baseUrl, string buildId)
210+
=> _downloadsUrl[browser](platform, buildId, baseUrl);
211211

212212
private static void ExtractTar(string zipPath, string folderPath)
213213
{

lib/PuppeteerSharp/BrowserFetcherOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class BrowserFetcherOptions
1717
public delegate Task CustomFileDownloadAction(string address, string fileName);
1818

1919
/// <summary>
20-
/// Product. Defaults to Chrome.
20+
/// Browser. Defaults to Chrome.
2121
/// </summary>
2222
public SupportedBrowser Browser { get; set; } = SupportedBrowser.Chrome;
2323

lib/PuppeteerSharp/LaunchOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public bool Headless
5353
/// <summary>
5454
/// Additional arguments to pass to the browser instance. List of Chromium flags can be found <a href="http://peter.sh/experiments/chromium-command-line-switches/">here</a>.
5555
/// </summary>
56-
public string[] Args { get; set; } = Array.Empty<string>();
56+
public string[] Args { get; set; } = [];
5757

5858
/// <summary>
5959
/// Maximum time in milliseconds to wait for the browser instance to start. Defaults to 30000 (30 seconds). Pass 0 to disable timeout.

lib/PuppeteerSharp/Launcher.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public async Task<IBrowser> LaunchAsync(LaunchOptions options)
6363
{
6464
SupportedBrowser.Chrome or SupportedBrowser.Chromium => new ChromeLauncher(executable, options),
6565
SupportedBrowser.Firefox => new FirefoxLauncher(executable, options),
66-
_ => throw new ArgumentException("Invalid product"),
66+
_ => throw new ArgumentException("Invalid browser"),
6767
};
6868

6969
try
@@ -135,14 +135,14 @@ public async Task<IBrowser> ConnectAsync(ConnectOptions options)
135135

136136
var version = await connection.SendAsync<BrowserGetVersionResponse>("Browser.getVersion").ConfigureAwait(false);
137137

138-
var product = version.Product.ToLower(CultureInfo.CurrentCulture).Contains("firefox")
138+
var browser = version.Product.ToLower(CultureInfo.CurrentCulture).Contains("firefox")
139139
? SupportedBrowser.Firefox
140140
: SupportedBrowser.Chromium;
141141

142142
var response = await connection.SendAsync<GetBrowserContextsResponse>("Target.getBrowserContexts").ConfigureAwait(false);
143143
return await CdpBrowser
144144
.CreateAsync(
145-
product,
145+
browser,
146146
connection,
147147
response.BrowserContextIds,
148148
options.IgnoreHTTPSErrors,

0 commit comments

Comments
 (0)