File tree 1 file changed +6
-7
lines changed
1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -73,10 +73,9 @@ Only works with Chromium browser's persistent context.
73
73
Emitted when new background page is created in the context.
74
74
75
75
``` java
76
- Page backgroundPage = context. waitForBackgroundPage(() - > {
77
- page . getByText( " activate extension " ) . click( );
76
+ context. onBackgroundPage(backgroundPage - > {
77
+ System . out . println(backgroundPage . url() );
78
78
});
79
- System . out. println(backgroundPage. evaluate(" location.href" ));
80
79
```
81
80
82
81
``` js
@@ -92,11 +91,11 @@ background_page = context.wait_for_event("backgroundpage")
92
91
```
93
92
94
93
``` csharp
95
- var backgroundPage = await context . RunAndWaitForBackgoundPageAsync ( async =>
94
+ context . BackgroundPage += ( backgroundPage ) =>
96
95
{
97
- await page . GetByText ( " activate extension " ). ClickAsync ( );
98
- }) ;
99
- Console . WriteLine ( await backgroundPage . EvaluateAsync < string >( " location.href " ));
96
+ Console . WriteLine ( backgroundPage . Url () );
97
+ };
98
+
100
99
```
101
100
102
101
## event: BrowserContext.close
You can’t perform that action at this time.
0 commit comments