Skip to content

Commit

Permalink
docs(java): add BrowserContext.backgroundPage(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
yury-s committed Apr 1, 2024
1 parent 4d8babb commit 8ee98c3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/src/api/class-browsercontext.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ await context.CloseAsync();

## event: BrowserContext.backgroundPage
* since: v1.11
* langs: js, python
* langs: js, python, java
- argument: <[Page]>

:::note
Expand All @@ -73,6 +73,13 @@ Only works with Chromium browser's persistent context.

Emitted when new background page is created in the context.

```java
Page backgroundPage = context.waitForBackgroundPage(() -> {
page.getByText("activate extension").click();
});
System.out.println(backgroundPage.evaluate("location.href"));
```

```js
const backgroundPage = await context.waitForEvent('backgroundpage');
```
Expand Down Expand Up @@ -441,7 +448,7 @@ Script to be evaluated in all pages in the browser context. Optional.

## method: BrowserContext.backgroundPages
* since: v1.11
* langs: js, python
* langs: js, python, java
- returns: <[Array]<[Page]>>

:::note
Expand Down

0 comments on commit 8ee98c3

Please sign in to comment.