Struct chromiumoxide::browser::Browser [−][src]
A Browser
is created when chromiumoxide connects to a Chromium instance.
Implementations
impl Browser
[src]
pub async fn connect(debug_ws_url: impl Into<String>) -> Result<(Self, Handler)>
[src]
Connect to an already running chromium instance via websocket
pub async fn launch(config: BrowserConfig) -> Result<(Self, Handler)>
[src]
Launches a new instance of chromium
in the background and attaches to
its debug web socket.
This fails when no chromium executable could be detected.
This fails if no web socket url could be detected from the child processes stderr for more than 20 seconds.
pub async fn start_incognito_context(&mut self) -> Result<&mut Self>
[src]
If not launched as incognito this creates a new incognito browser context. After that this browser exists within the incognito session. New pages created while being in incognito mode will also run in the incognito context. Incognito contexts won’t share cookies/cache with other browser contexts.
pub async fn quit_incognito_context(&mut self) -> Result<&mut Self>
[src]
If a incognito session was created with
Browser::start_incognito_context
this disposes this context.
Note This will also dispose all pages that were running within the
incognito context.
pub fn websocket_address(&self) -> &String
[src]
Returns the address of the websocket this browser is attached to
pub fn is_incognito(&self) -> bool
[src]
Whether the BrowserContext is incognito.
pub fn config(&self) -> Option<&BrowserConfig>
[src]
The config of the spawned chromium instance if any.
pub async fn new_page(
&self,
params: impl Into<CreateTargetParams>
) -> Result<Page>
[src]
&self,
params: impl Into<CreateTargetParams>
) -> Result<Page>
Create a new browser page
pub async fn version(&self) -> Result<GetVersionReturns>
[src]
Version information about the browser
pub async fn user_agent(&self) -> Result<String>
[src]
Returns the user agent of the browser
pub async fn execute<T: Command>(
&self,
cmd: T
) -> Result<CommandResponse<T::Response>>
[src]
&self,
cmd: T
) -> Result<CommandResponse<T::Response>>
Call a browser method.
pub async fn pages(&self) -> Result<Vec<Page>>
[src]
Return all of the pages of the browser
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Browser
impl Send for Browser
impl Sync for Browser
impl Unpin for Browser
impl !UnwindSafe for Browser
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,