pub struct Browser { /* private fields */ }Implementations§
Source§impl Browser
impl Browser
Sourcepub fn contexts(&self) -> Result<Vec<BrowserContext>, Error>
pub fn contexts(&self) -> Result<Vec<BrowserContext>, Error>
Returns an array of all open browser contexts. In a newly created browser, this will return zero browser contexts.
const browser = await pw.webkit.launch();
console.log(browser.contexts().length); // prints `0`
const context = await browser.newContext();
console.log(browser.contexts().length); // prints `1`pub fn exists(&self) -> bool
Sourcepub fn context_builder(&self) -> ContextBuilder<'_, '_, '_, '_, '_, '_, '_>
pub fn context_builder(&self) -> ContextBuilder<'_, '_, '_, '_, '_, '_, '_>
new_context BrowserContext
Creates a new browser context. It won’t share cookies/cache with other browser contexts.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Browser
impl RefUnwindSafe for Browser
impl Send for Browser
impl Sync for Browser
impl Unpin for Browser
impl UnwindSafe for Browser
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