Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 50 additions & 52 deletions dotnet/docs/api/class-browsercontext.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -118,28 +118,6 @@ The order of evaluation of multiple scripts installed via [BrowserContext.AddIni

---

### BackgroundPages {#browser-context-background-pages}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.11</font><x-search>browserContext.BackgroundPages</x-search>

:::note

Background pages are only supported on Chromium-based browsers.
:::

All existing background pages in the context.

**Usage**

```csharp
BrowserContext.BackgroundPages
```

**Returns**
- [IReadOnlyList]&lt;[Page]&gt;<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-context-background-pages-return"/><a href="#browser-context-background-pages-return" class="list-anchor">#</a>

---

### Browser {#browser-context-browser}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>browserContext.Browser</x-search>
Expand Down Expand Up @@ -1042,36 +1020,6 @@ BrowserContext.Tracing

## Events

### event BackgroundPage {#browser-context-event-background-page}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.11</font><x-search>browserContext.event BackgroundPage</x-search>

:::note

Only works with Chromium browser's persistent context.
:::

Emitted when new background page is created in the context.

```csharp
context.BackgroundPage += (_, backgroundPage) =>
{
Console.WriteLine(backgroundPage.Url);
};

```

**Usage**

```csharp
BrowserContext.BackgroundPage += async (_, page) => {};
```

**Event data**
- [Page]

---

### event Close {#browser-context-event-close}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>browserContext.event Close</x-search>
Expand Down Expand Up @@ -1262,6 +1210,56 @@ BrowserContext.WebError += async (_, webError) => {};
**Event data**
- [WebError]

---

## Deprecated

### event BackgroundPage {#browser-context-event-background-page}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.11</font><x-search>browserContext.event BackgroundPage</x-search>

:::warning Deprecated

Background pages have been removed from Chromium together with Manifest V2 extensions.

:::


This event is not emitted.

**Usage**

```csharp
BrowserContext.BackgroundPage += async (_, page) => {};
```

**Event data**
- [Page]

---

### BackgroundPages {#browser-context-background-pages}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.11</font><x-search>browserContext.BackgroundPages</x-search>

:::warning Deprecated

Background pages have been removed from Chromium together with Manifest V2 extensions.

:::


Returns an empty list.

**Usage**

```csharp
BrowserContext.BackgroundPages
```

**Returns**
- [IReadOnlyList]&lt;[Page]&gt;<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-context-background-pages-return"/><a href="#browser-context-background-pages-return" class="list-anchor">#</a>


[Accessibility]: /api/class-accessibility.mdx "Accessibility"
[APIRequest]: /api/class-apirequest.mdx "APIRequest"
Expand Down
2 changes: 1 addition & 1 deletion dotnet/docs/test-runners.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ xUnit v3 uses the [`conservative` parallelism algorithm](https://xunit.net/docs/

<TabItem value="nunit">

To customize context options, you can override the `ContextOptions` method of your test class derived from `Microsoft.Playwright.MSTest.PageTest` or `Microsoft.Playwright.MSTest.ContextTest`. See the following example:
To customize context options, you can override the `ContextOptions` method of your test class derived from `Microsoft.Playwright.NUnit.PageTest` or `Microsoft.Playwright.NUnit.ContextTest`. See the following example:

```csharp
using Microsoft.Playwright.NUnit;
Expand Down
100 changes: 50 additions & 50 deletions java/docs/api/class-browsercontext.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,28 +117,6 @@ The order of evaluation of multiple scripts installed via [BrowserContext.addIni

---

### backgroundPages {#browser-context-background-pages}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.11</font><x-search>browserContext.backgroundPages</x-search>

:::note

Background pages are only supported on Chromium-based browsers.
:::

All existing background pages in the context.

**Usage**

```java
BrowserContext.backgroundPages();
```

**Returns**
- [List]&lt;[Page]&gt;<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-context-background-pages-return"/><a href="#browser-context-background-pages-return" class="list-anchor">#</a>

---

### browser {#browser-context-browser}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>browserContext.browser</x-search>
Expand Down Expand Up @@ -1028,34 +1006,6 @@ BrowserContext.tracing()

## Events

### onBackgroundPage(handler) {#browser-context-event-background-page}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.11</font><x-search>browserContext.onBackgroundPage(handler)</x-search>

:::note

Only works with Chromium browser's persistent context.
:::

Emitted when new background page is created in the context.

```java
context.onBackgroundPage(backgroundPage -> {
System.out.println(backgroundPage.url());
});
```

**Usage**

```java
BrowserContext.onBackgroundPage(handler)
```

**Event data**
- [Page]

---

### onClose(handler) {#browser-context-event-close}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>browserContext.onClose(handler)</x-search>
Expand Down Expand Up @@ -1242,6 +1192,56 @@ BrowserContext.onWebError(handler)
**Event data**
- [WebError]

---

## Deprecated

### onBackgroundPage(handler) {#browser-context-event-background-page}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.11</font><x-search>browserContext.onBackgroundPage(handler)</x-search>

:::warning Deprecated

Background pages have been removed from Chromium together with Manifest V2 extensions.

:::


This event is not emitted.

**Usage**

```java
BrowserContext.onBackgroundPage(handler)
```

**Event data**
- [Page]

---

### backgroundPages {#browser-context-background-pages}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.11</font><x-search>browserContext.backgroundPages</x-search>

:::warning Deprecated

Background pages have been removed from Chromium together with Manifest V2 extensions.

:::


Returns an empty list.

**Usage**

```java
BrowserContext.backgroundPages();
```

**Returns**
- [List]&lt;[Page]&gt;<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-context-background-pages-return"/><a href="#browser-context-background-pages-return" class="list-anchor">#</a>


[APIRequest]: /api/class-apirequest.mdx "APIRequest"
[APIRequestContext]: /api/class-apirequestcontext.mdx "APIRequestContext"
Expand Down
96 changes: 48 additions & 48 deletions nodejs/docs/api/class-browsercontext.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -128,28 +128,6 @@ The order of evaluation of multiple scripts installed via [browserContext.addIni

---

### backgroundPages {#browser-context-background-pages}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.11</font><x-search>browserContext.backgroundPages</x-search>

:::note

Background pages are only supported on Chromium-based browsers.
:::

All existing background pages in the context.

**Usage**

```js
browserContext.backgroundPages();
```

**Returns**
- [Array]&lt;[Page]&gt;<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-context-background-pages-return"/><a href="#browser-context-background-pages-return" class="list-anchor">#</a>

---

### browser {#browser-context-browser}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>browserContext.browser</x-search>
Expand Down Expand Up @@ -1059,32 +1037,6 @@ browserContext.tracing

## Events

### on('backgroundpage') {#browser-context-event-background-page}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.11</font><x-search>browserContext.on('backgroundpage')</x-search>

:::note

Only works with Chromium browser's persistent context.
:::

Emitted when new background page is created in the context.

```js
const backgroundPage = await context.waitForEvent('backgroundpage');
```

**Usage**

```js
browserContext.on('backgroundpage', data => {});
```

**Event data**
- [Page]

---

### on('close') {#browser-context-event-close}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>browserContext.on('close')</x-search>
Expand Down Expand Up @@ -1299,6 +1251,54 @@ browserContext.on('weberror', data => {});

## Deprecated

### on('backgroundpage') {#browser-context-event-background-page}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.11</font><x-search>browserContext.on('backgroundpage')</x-search>

:::warning Deprecated

Background pages have been removed from Chromium together with Manifest V2 extensions.

:::


This event is not emitted.

**Usage**

```js
browserContext.on('backgroundpage', data => {});
```

**Event data**
- [Page]

---

### backgroundPages {#browser-context-background-pages}

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.11</font><x-search>browserContext.backgroundPages</x-search>

:::warning Deprecated

Background pages have been removed from Chromium together with Manifest V2 extensions.

:::


Returns an empty list.

**Usage**

```js
browserContext.backgroundPages();
```

**Returns**
- [Array]&lt;[Page]&gt;<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-context-background-pages-return"/><a href="#browser-context-background-pages-return" class="list-anchor">#</a>

---

### setHTTPCredentials {#browser-context-set-http-credentials}

<font size="2" style={{position: "relative", top: "-20px"}}>Added before v1.9</font><x-search>browserContext.setHTTPCredentials</x-search>
Expand Down
Loading
Loading