File tree 1 file changed +15
-2
lines changed
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,6 @@ await context.CloseAsync();
64
64
65
65
## event: BrowserContext.backgroundPage
66
66
* since: v1.11
67
- * langs: js, python
68
67
- argument: <[ Page] >
69
68
70
69
::: note
@@ -73,6 +72,13 @@ Only works with Chromium browser's persistent context.
73
72
74
73
Emitted when new background page is created in the context.
75
74
75
+ ``` java
76
+ Page backgroundPage = context. waitForBackgroundPage(() - > {
77
+ page. getByText(" activate extension" ). click();
78
+ });
79
+ System . out. println(backgroundPage. evaluate(" location.href" ));
80
+ ```
81
+
76
82
``` js
77
83
const backgroundPage = await context .waitForEvent (' backgroundpage' );
78
84
```
@@ -85,6 +91,14 @@ background_page = await context.wait_for_event("backgroundpage")
85
91
background_page = context.wait_for_event(" backgroundpage" )
86
92
```
87
93
94
+ ``` csharp
95
+ var backgroundPage = await context .RunAndWaitForBackgoundPageAsync (async =>
96
+ {
97
+ await page .GetByText (" activate extension" ).ClickAsync ();
98
+ });
99
+ Console .WriteLine (await backgroundPage .EvaluateAsync <string >(" location.href" ));
100
+ ```
101
+
88
102
## event: BrowserContext.close
89
103
* since: v1.8
90
104
- argument: <[ BrowserContext] >
@@ -441,7 +455,6 @@ Script to be evaluated in all pages in the browser context. Optional.
441
455
442
456
## method: BrowserContext.backgroundPages
443
457
* since: v1.11
444
- * langs: js, python
445
458
- returns: <[ Array] <[ Page] >>
446
459
447
460
::: note
You can’t perform that action at this time.
0 commit comments