pub enum Event {
Close,
Page(Page),
}Variants§
Close
Emitted when Browser context gets closed. This might happen because of one of the following:
- Browser context is closed.
- Browser application is closed or crashed.
- The [
method: Browser.close] method was called.
Page(Page)
The event is emitted when a new Page is created in the BrowserContext. The page may still be loading. The event will
also fire for popup pages. See also [event: Page.popup] to receive events about popups relevant to a specific page.
The earliest moment that page is available is when it has navigated to the initial url. For example, when opening a
popup with window.open('http://example.com'), this event will fire when the network request to http://example.com is
done and its response has started loading in the popup.
const [newPage] = await Promise.all([
context.waitForEvent('page'),
page.click('a[target=_blank]'),
]);
console.log(await newPage.evaluate('location.href'));Trait Implementations§
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more