Skip to content

Commit

Permalink
chore: decouple generator from languages
Browse files Browse the repository at this point in the history
This also fixes the rendering of options to be language-specific.
  • Loading branch information
dgozman committed Sep 25, 2024
1 parent e944a0f commit b2e01ba
Show file tree
Hide file tree
Showing 65 changed files with 611 additions and 568 deletions.
2 changes: 1 addition & 1 deletion dotnet/docs/api/class-accessibility.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This method is deprecated. Please use other libraries such as [Axe](https://www.
Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page.

:::note
The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers. Playwright will discard them as well for an easier to process tree, unless `interestingOnly` is set to `false`.
The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers. Playwright will discard them as well for an easier to process tree, unless `InterestingOnly` is set to `false`.
:::

**Usage**
Expand Down
4 changes: 2 additions & 2 deletions dotnet/docs/api/class-apirequestcontext.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ var data = new Dictionary<string, object>() {
await Request.FetchAsync("https://example.com/api/createBook", new() { Method = "post", DataObject = data });
```

The common way to send file(s) in the body of a request is to upload them as form fields with `multipart/form-data` encoding. Use [FormData] to construct request body and pass it to the request as `multipart` parameter:
The common way to send file(s) in the body of a request is to upload them as form fields with `multipart/form-data` encoding. Use [FormData] to construct request body and pass it to the request as `Multipart` parameter:

```csharp
var file = new FilePayload()
Expand Down Expand Up @@ -557,7 +557,7 @@ await ApiRequestContext.StorageStateAsync(options);
- `options` `ApiRequestContextStorageStateOptions?` *(optional)*
- `Path` [string]? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="api-request-context-storage-state-option-path"/><a href="#api-request-context-storage-state-option-path" class="list-anchor">#</a>

The file path to save the storage state to. If `path` is a relative path, then it is resolved relative to current working directory. If no path is provided, storage state is still returned, but won't be saved to the disk.
The file path to save the storage state to. If `Path` is a relative path, then it is resolved relative to current working directory. If no path is provided, storage state is still returned, but won't be saved to the disk.

**Returns**
- [string]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="api-request-context-storage-state-return"/><a href="#api-request-context-storage-state-return" class="list-anchor">#</a>
Expand Down
4 changes: 2 additions & 2 deletions dotnet/docs/api/class-browser.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ await browser.CloseAsync();

page height in pixels.

Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport` is set.
Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `Viewport` is set.
- `ServiceWorkers` `enum ServiceWorkerPolicy { Allow, Block }?` *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-new-context-option-service-workers"/><a href="#browser-new-context-option-service-workers" class="list-anchor">#</a>

Whether to allow sites to register Service workers. Defaults to `'allow'`.
Expand Down Expand Up @@ -530,7 +530,7 @@ await Browser.NewPageAsync(options);

page height in pixels.

Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport` is set.
Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `Viewport` is set.
- `ServiceWorkers` `enum ServiceWorkerPolicy { Allow, Block }?` *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-new-page-option-service-workers"/><a href="#browser-new-page-option-service-workers" class="list-anchor">#</a>

Whether to allow sites to register Service workers. Defaults to `'allow'`.
Expand Down
6 changes: 3 additions & 3 deletions dotnet/docs/api/class-browsercontext.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ Enabling routing disables http cache.
**Arguments**
- `url` [string] | [Regex] | [Func]&lt;[string], bool&gt;<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-context-route-option-url"/><a href="#browser-context-route-option-url" class="list-anchor">#</a>

A glob pattern, regex pattern or predicate receiving [URL] to match while routing. When a `baseURL` via the context options was provided and the passed URL is a path, it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor.
A glob pattern, regex pattern or predicate receiving [URL] to match while routing. When a `BaseURL` via the context options was provided and the passed URL is a path, it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor.
- `handler` [Action]&lt;[Route]&gt;<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-context-route-option-handler"/><a href="#browser-context-route-option-handler" class="list-anchor">#</a>

handler function to route the request.
Expand Down Expand Up @@ -635,7 +635,7 @@ await context.RouteWebSocketAsync("/ws", async ws => {
**Arguments**
- `url` [string] | [Regex] | [Func]&lt;[string], bool&gt;<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-context-route-web-socket-option-url"/><a href="#browser-context-route-web-socket-option-url" class="list-anchor">#</a>

Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the `baseURL` from the context options.
Only WebSockets with the url matching this pattern will be routed. A string pattern can be relative to the `BaseURL` from the context options.
- `handler` [Action]&lt;[WebSocketRoute]&gt;<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-context-route-web-socket-option-handler"/><a href="#browser-context-route-web-socket-option-handler" class="list-anchor">#</a>

Handler function to route the WebSocket.
Expand Down Expand Up @@ -906,7 +906,7 @@ await BrowserContext.StorageStateAsync(options);
- `options` `BrowserContextStorageStateOptions?` *(optional)*
- `Path` [string]? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-context-storage-state-option-path"/><a href="#browser-context-storage-state-option-path" class="list-anchor">#</a>

The file path to save the storage state to. If `path` is a relative path, then it is resolved relative to current working directory. If no path is provided, storage state is still returned, but won't be saved to the disk.
The file path to save the storage state to. If `Path` is a relative path, then it is resolved relative to current working directory. If no path is provided, storage state is still returned, but won't be saved to the disk.

**Returns**
- [string]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-context-storage-state-return"/><a href="#browser-context-storage-state-return" class="list-anchor">#</a>
Expand Down
26 changes: 13 additions & 13 deletions dotnet/docs/api/class-browsertype.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ Returns the browser instance.

**Usage**

You can use `ignoreDefaultArgs` to filter out `--mute-audio` from default arguments:
You can use `IgnoreDefaultArgs` to filter out `--mute-audio` from default arguments:

```csharp
var browser = await playwright.Chromium.LaunchAsync(new() {
IgnoreDefaultArgs = new[] { "--mute-audio" }
});
```

> **Chromium-only** Playwright can also be used to control the Google Chrome or Microsoft Edge browsers, but it works best with the version of Chromium it is bundled with. There is no guarantee it will work with any other version. Use `executablePath` option with extreme caution.
> **Chromium-only** Playwright can also be used to control the Google Chrome or Microsoft Edge browsers, but it works best with the version of Chromium it is bundled with. There is no guarantee it will work with any other version. Use `ExecutablePath` option with extreme caution.
>
> If Google Chrome (rather than Chromium) is preferred, a [Chrome Canary](https://www.google.com/chrome/browser/canary.html) or [Dev Channel](https://www.chromium.org/getting-involved/dev-channel) build is suggested.
>
Expand Down Expand Up @@ -179,7 +179,7 @@ var browser = await playwright.Chromium.LaunchAsync(new() {
:::


**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the `headless` option will be set `false`.
**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the `Headless` option will be set `false`.
- `DownloadsPath` [string]? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-type-launch-option-downloads-path"/><a href="#browser-type-launch-option-downloads-path" class="list-anchor">#</a>

If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created in is closed.
Expand All @@ -188,7 +188,7 @@ var browser = await playwright.Chromium.LaunchAsync(new() {
Specify environment variables that will be visible to the browser. Defaults to `process.env`.
- `ExecutablePath` [string]? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-type-launch-option-executable-path"/><a href="#browser-type-launch-option-executable-path" class="list-anchor">#</a>

Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, Firefox or WebKit, use at your own risk.
Path to a browser executable to run instead of the bundled one. If `ExecutablePath` is a relative path, then it is resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, Firefox or WebKit, use at your own risk.
- `FirefoxUserPrefs` [IDictionary]?&lt;[string], [object]&gt; *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-type-launch-option-firefox-user-prefs"/><a href="#browser-type-launch-option-firefox-user-prefs" class="list-anchor">#</a>

Firefox user preferences. Learn more about the Firefox user preferences at [`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).
Expand All @@ -203,13 +203,13 @@ var browser = await playwright.Chromium.LaunchAsync(new() {
Close the browser process on SIGTERM. Defaults to `true`.
- `Headless` [bool]? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-type-launch-option-headless"/><a href="#browser-type-launch-option-headless" class="list-anchor">#</a>

Whether to run browser in headless mode. More details for [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the `devtools` option is `true`.
Whether to run browser in headless mode. More details for [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the `Devtools` option is `true`.
- `IgnoreAllDefaultArgs` [bool]? *(optional)* <font size="2">Added in: v1.9</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-type-launch-option-ignore-all-default-args"/><a href="#browser-type-launch-option-ignore-all-default-args" class="list-anchor">#</a>

If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous option; use with care. Defaults to `false`.
If `true`, Playwright does not pass its own configurations args and only uses the ones from `Args`. Dangerous option; use with care. Defaults to `false`.
- `IgnoreDefaultArgs` [IEnumerable]?&lt;[string]&gt; *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-type-launch-option-ignore-default-args"/><a href="#browser-type-launch-option-ignore-default-args" class="list-anchor">#</a>

If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous option; use with care.
If `true`, Playwright does not pass its own configurations args and only uses the ones from `Args`. Dangerous option; use with care.
- `Proxy` Proxy? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-type-launch-option-proxy"/><a href="#browser-type-launch-option-proxy" class="list-anchor">#</a>
- `Server` [string]

Expand Down Expand Up @@ -333,7 +333,7 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options);
:::


**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the `headless` option will be set `false`.
**Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the `Headless` option will be set `false`.
- `DownloadsPath` [string]? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-type-launch-persistent-context-option-downloads-path"/><a href="#browser-type-launch-persistent-context-option-downloads-path" class="list-anchor">#</a>

If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created in is closed.
Expand All @@ -342,7 +342,7 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options);
Specify environment variables that will be visible to the browser. Defaults to `process.env`.
- `ExecutablePath` [string]? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-type-launch-persistent-context-option-executable-path"/><a href="#browser-type-launch-persistent-context-option-executable-path" class="list-anchor">#</a>

Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, Firefox or WebKit, use at your own risk.
Path to a browser executable to run instead of the bundled one. If `ExecutablePath` is a relative path, then it is resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, Firefox or WebKit, use at your own risk.
- `ExtraHTTPHeaders` [IDictionary]?&lt;[string], [string]&gt; *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-type-launch-persistent-context-option-extra-http-headers"/><a href="#browser-type-launch-persistent-context-option-extra-http-headers" class="list-anchor">#</a>

An object containing additional HTTP headers to be sent with every request. Defaults to none.
Expand Down Expand Up @@ -376,7 +376,7 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options);
Specifies if viewport supports touch events. Defaults to false. Learn more about [mobile emulation](../emulation.mdx#devices).
- `Headless` [bool]? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-type-launch-persistent-context-option-headless"/><a href="#browser-type-launch-persistent-context-option-headless" class="list-anchor">#</a>

Whether to run browser in headless mode. More details for [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the `devtools` option is `true`.
Whether to run browser in headless mode. More details for [Chromium](https://developers.google.com/web/updates/2017/04/headless-chrome) and [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode). Defaults to `true` unless the `Devtools` option is `true`.
- `HttpCredentials` HttpCredentials? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-type-launch-persistent-context-option-http-credentials"/><a href="#browser-type-launch-persistent-context-option-http-credentials" class="list-anchor">#</a>
- `Username` [string]

Expand All @@ -394,10 +394,10 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options);
Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication). If no origin is specified, the username and password are sent to any servers upon unauthorized responses.
- `IgnoreAllDefaultArgs` [bool]? *(optional)* <font size="2">Added in: v1.9</font><a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-type-launch-persistent-context-option-ignore-all-default-args"/><a href="#browser-type-launch-persistent-context-option-ignore-all-default-args" class="list-anchor">#</a>

If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous option; use with care. Defaults to `false`.
If `true`, Playwright does not pass its own configurations args and only uses the ones from `Args`. Dangerous option; use with care. Defaults to `false`.
- `IgnoreDefaultArgs` [IEnumerable]?&lt;[string]&gt; *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-type-launch-persistent-context-option-ignore-default-args"/><a href="#browser-type-launch-persistent-context-option-ignore-default-args" class="list-anchor">#</a>

If `true`, Playwright does not pass its own configurations args and only uses the ones from `args`. Dangerous option; use with care.
If `true`, Playwright does not pass its own configurations args and only uses the ones from `Args`. Dangerous option; use with care.
- `IgnoreHTTPSErrors` [bool]? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-type-launch-persistent-context-option-ignore-https-errors"/><a href="#browser-type-launch-persistent-context-option-ignore-https-errors" class="list-anchor">#</a>

Whether to ignore HTTPS errors when sending network requests. Defaults to `false`.
Expand Down Expand Up @@ -467,7 +467,7 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options);

page height in pixels.

Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `viewport` is set.
Emulates consistent window screen size available inside web page via `window.screen`. Is only used when the `Viewport` is set.
- `ServiceWorkers` `enum ServiceWorkerPolicy { Allow, Block }?` *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-type-launch-persistent-context-option-service-workers"/><a href="#browser-type-launch-persistent-context-option-service-workers" class="list-anchor">#</a>

Whether to allow sites to register Service workers. Defaults to `'allow'`.
Expand Down
Loading

0 comments on commit b2e01ba

Please sign in to comment.