docs(java): add BrowserContext.backgroundPage(s)
Refereence https://github.com/microsoft/playwright-java/issues/1530
This commit is contained in:
parent
4d8babb27c
commit
8ee98c3fa1
|
|
@ -64,7 +64,7 @@ await context.CloseAsync();
|
||||||
|
|
||||||
## event: BrowserContext.backgroundPage
|
## event: BrowserContext.backgroundPage
|
||||||
* since: v1.11
|
* since: v1.11
|
||||||
* langs: js, python
|
* langs: js, python, java
|
||||||
- argument: <[Page]>
|
- argument: <[Page]>
|
||||||
|
|
||||||
:::note
|
:::note
|
||||||
|
|
@ -73,6 +73,13 @@ Only works with Chromium browser's persistent context.
|
||||||
|
|
||||||
Emitted when new background page is created in the 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
|
```js
|
||||||
const backgroundPage = await context.waitForEvent('backgroundpage');
|
const backgroundPage = await context.waitForEvent('backgroundpage');
|
||||||
```
|
```
|
||||||
|
|
@ -441,7 +448,7 @@ Script to be evaluated in all pages in the browser context. Optional.
|
||||||
|
|
||||||
## method: BrowserContext.backgroundPages
|
## method: BrowserContext.backgroundPages
|
||||||
* since: v1.11
|
* since: v1.11
|
||||||
* langs: js, python
|
* langs: js, python, java
|
||||||
- returns: <[Array]<[Page]>>
|
- returns: <[Array]<[Page]>>
|
||||||
|
|
||||||
:::note
|
:::note
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue