pub struct FirefoxBrowser { /* private fields */ }Implementations§
Source§impl FirefoxBrowser
impl FirefoxBrowser
pub async fn new(config: FirefoxConfig) -> FirefoxBrowser
pub async fn connect_bidi(&mut self)
pub fn get_config(&self) -> &FirefoxConfig
pub fn get_browser_process(&self) -> &Option<Process>
Trait Implementations§
Source§impl BidiBrowser for FirefoxBrowser
impl BidiBrowser for FirefoxBrowser
type Transport = WebsocketConnectionTransport
type BrowserNode = FirefoxNode<WebsocketConnectionTransport>
Source§fn driver(&self) -> &BidiDriver<WebsocketConnectionTransport>
fn driver(&self) -> &BidiDriver<WebsocketConnectionTransport>
Access the underlying BiDi driver (immutable).
Source§fn driver_mut(&mut self) -> &mut BidiDriver<WebsocketConnectionTransport>
fn driver_mut(&mut self) -> &mut BidiDriver<WebsocketConnectionTransport>
Access the underlying BiDi driver (mutable).
Source§fn build_node(
&self,
raw_node: NodeRemoteValue,
locator: Locator,
context: BrowsingContext,
) -> FirefoxNode<WebsocketConnectionTransport>
fn build_node( &self, raw_node: NodeRemoteValue, locator: Locator, context: BrowsingContext, ) -> FirefoxNode<WebsocketConnectionTransport>
Construct a browser-specific node from raw BiDi data.
Source§async fn close(self) -> Result<(), BrowserCloseError>
async fn close(self) -> Result<(), BrowserCloseError>
Closes the browser: ends the BiDi session, closes the WebSocket connection,
and performs any browser-specific cleanup (e.g. kills the browser process).
Navigates to the specified URL in the active context.
Navigates to the specified URL with custom options (wait state, context).
Source§fn close_context(
&mut self,
context: DomainBrowsingContext,
) -> impl Future<Output = Result<(), ContextCloseError>> + Send
fn close_context( &mut self, context: DomainBrowsingContext, ) -> impl Future<Output = Result<(), ContextCloseError>> + Send
Closes a browsing context (tab/window).
Source§fn create_context(
&mut self,
background: bool,
) -> impl Future<Output = Result<DomainBrowsingContext, ContextCreationError>> + Send
fn create_context( &mut self, background: bool, ) -> impl Future<Output = Result<DomainBrowsingContext, ContextCreationError>> + Send
Creates a new browsing context (tab) with default options.
Source§fn create_context_with_options(
&mut self,
background: bool,
options: CreateContextOptions,
) -> impl Future<Output = Result<DomainBrowsingContext, ContextCreationError>> + Send
fn create_context_with_options( &mut self, background: bool, options: CreateContextOptions, ) -> impl Future<Output = Result<DomainBrowsingContext, ContextCreationError>> + Send
Creates a new browsing context with custom options (type, reference context, background).
Source§fn find_nodes(
&mut self,
locator: Locator,
) -> impl Future<Output = Result<Vec<Self::BrowserNode>, FindNodesError>> + Send
fn find_nodes( &mut self, locator: Locator, ) -> impl Future<Output = Result<Vec<Self::BrowserNode>, FindNodesError>> + Send
Finds all elements matching the given locator in the active context.
Source§fn find_nodes_with_options(
&mut self,
locator: Locator,
options: FindNodesOptions,
) -> impl Future<Output = Result<Vec<Self::BrowserNode>, FindNodesError>> + Send
fn find_nodes_with_options( &mut self, locator: Locator, options: FindNodesOptions, ) -> impl Future<Output = Result<Vec<Self::BrowserNode>, FindNodesError>> + Send
Finds all elements matching the given locator with custom options (context, count, serialization, start nodes).
Source§fn find_node(
&mut self,
locator: Locator,
) -> impl Future<Output = Result<Option<Self::BrowserNode>, FindNodesError>> + Send
fn find_node( &mut self, locator: Locator, ) -> impl Future<Output = Result<Option<Self::BrowserNode>, FindNodesError>> + Send
Finds the first element matching the given locator in the active context. Read more
Source§fn find_node_with_options(
&mut self,
locator: Locator,
options: FindNodesOptions,
) -> impl Future<Output = Result<Option<Self::BrowserNode>, FindNodesError>> + Send
fn find_node_with_options( &mut self, locator: Locator, options: FindNodesOptions, ) -> impl Future<Output = Result<Option<Self::BrowserNode>, FindNodesError>> + Send
Finds the first element matching the given locator with custom options. Read more
Source§fn wait_for_nodes(
&mut self,
locator: Locator,
) -> impl Future<Output = Result<Vec<Self::BrowserNode>, FindNodesError>> + Send
fn wait_for_nodes( &mut self, locator: Locator, ) -> impl Future<Output = Result<Vec<Self::BrowserNode>, FindNodesError>> + Send
Waits for elements matching the locator to appear (default 4s timeout).
Source§fn wait_for_nodes_with_options(
&mut self,
locator: Locator,
options: WaitForNodesOptions,
) -> impl Future<Output = Result<Vec<Self::BrowserNode>, FindNodesError>> + Send
fn wait_for_nodes_with_options( &mut self, locator: Locator, options: WaitForNodesOptions, ) -> impl Future<Output = Result<Vec<Self::BrowserNode>, FindNodesError>> + Send
Waits for elements matching the locator with custom options (context, timeout, poll interval).
Source§fn wait_for_node(
&mut self,
locator: Locator,
) -> impl Future<Output = Result<Option<Self::BrowserNode>, FindNodesError>> + Send
fn wait_for_node( &mut self, locator: Locator, ) -> impl Future<Output = Result<Option<Self::BrowserNode>, FindNodesError>> + Send
Waits for a single element matching the locator to appear (default 4s timeout). Read more
Source§fn wait_for_node_with_options(
&mut self,
locator: Locator,
options: WaitForNodesOptions,
) -> impl Future<Output = Result<Option<Self::BrowserNode>, FindNodesError>> + Send
fn wait_for_node_with_options( &mut self, locator: Locator, options: WaitForNodesOptions, ) -> impl Future<Output = Result<Option<Self::BrowserNode>, FindNodesError>> + Send
Waits for a single element matching the locator with custom options. Read more
Source§fn on_request<F, Fut>(
&mut self,
handler: F,
) -> impl Future<Output = Result<(), InterceptNetworkError>> + Send
fn on_request<F, Fut>( &mut self, handler: F, ) -> impl Future<Output = Result<(), InterceptNetworkError>> + Send
Registers a handler called for each network request (all URLs, all contexts).
Source§fn on_request_with_options<F, Fut>(
&mut self,
handler: F,
options: OnRequestOptions,
) -> impl Future<Output = Result<(), InterceptNetworkError>> + Send
fn on_request_with_options<F, Fut>( &mut self, handler: F, options: OnRequestOptions, ) -> impl Future<Output = Result<(), InterceptNetworkError>> + Send
Registers a handler called for each network request with custom URL pattern and context filters.
Source§fn subscribe_events<F, R>(
&mut self,
events: HashSet<&str>,
handler: F,
) -> impl Future<Output = Result<Option<SubscribeResult>, CommandResultError>> + Send
fn subscribe_events<F, R>( &mut self, events: HashSet<&str>, handler: F, ) -> impl Future<Output = Result<Option<SubscribeResult>, CommandResultError>> + Send
Subscribes to browser events and registers a handler.
Source§fn subscribe_events_with_options<F, R>(
&mut self,
events: HashSet<&str>,
handler: F,
options: SubscribeEventsOptions,
) -> impl Future<Output = Result<Option<SubscribeResult>, CommandResultError>> + Send
fn subscribe_events_with_options<F, R>( &mut self, events: HashSet<&str>, handler: F, options: SubscribeEventsOptions, ) -> impl Future<Output = Result<Option<SubscribeResult>, CommandResultError>> + Send
Subscribes to browser events with context and user context filters.
Source§fn add_event_handler<F, R>(
&mut self,
events: HashSet<&str>,
handler: F,
) -> impl Future<Output = String> + Send
fn add_event_handler<F, R>( &mut self, events: HashSet<&str>, handler: F, ) -> impl Future<Output = String> + Send
Adds an event handler without sending a subscription command. Read more
Source§fn evaluate_script(
&mut self,
expression: String,
await_promise: bool,
) -> impl Future<Output = Result<EvaluateResultSuccess, EvaluateResultError>> + Send
fn evaluate_script( &mut self, expression: String, await_promise: bool, ) -> impl Future<Output = Result<EvaluateResultSuccess, EvaluateResultError>> + Send
Evaluates a JavaScript expression in the active browsing context.
Source§fn evaluate_script_with_options(
&mut self,
expression: String,
await_promise: bool,
options: EvaluateScriptOptions,
) -> impl Future<Output = Result<EvaluateResultSuccess, EvaluateResultError>> + Send
fn evaluate_script_with_options( &mut self, expression: String, await_promise: bool, options: EvaluateScriptOptions, ) -> impl Future<Output = Result<EvaluateResultSuccess, EvaluateResultError>> + Send
Evaluates a JavaScript expression with custom options (target, result ownership, serialization).
Source§fn add_preload_script(
&mut self,
function_declaration: String,
) -> impl Future<Output = Result<String, EvaluateResultError>> + Send
fn add_preload_script( &mut self, function_declaration: String, ) -> impl Future<Output = Result<String, EvaluateResultError>> + Send
Adds a preload script that runs in every new browsing context.
Source§fn add_preload_script_with_options(
&mut self,
function_declaration: String,
options: AddPreloadScriptOptions,
) -> impl Future<Output = Result<String, EvaluateResultError>> + Send
fn add_preload_script_with_options( &mut self, function_declaration: String, options: AddPreloadScriptOptions, ) -> impl Future<Output = Result<String, EvaluateResultError>> + Send
Adds a preload script with custom options (arguments, contexts, sandbox).
Source§fn remove_preload_script(
&mut self,
script: String,
) -> impl Future<Output = Result<(), EvaluateResultError>> + Send
fn remove_preload_script( &mut self, script: String, ) -> impl Future<Output = Result<(), EvaluateResultError>> + Send
Removes a preload script by its ID.
Source§fn screenshot(
&mut self,
) -> impl Future<Output = Result<String, ScreenshotError>> + Send
fn screenshot( &mut self, ) -> impl Future<Output = Result<String, ScreenshotError>> + Send
Captures a screenshot of the active browsing context and returns base64-encoded image data.
Source§fn screenshot_with_options(
&mut self,
options: BrowserScreenshotOptions,
) -> impl Future<Output = Result<String, ScreenshotError>> + Send
fn screenshot_with_options( &mut self, options: BrowserScreenshotOptions, ) -> impl Future<Output = Result<String, ScreenshotError>> + Send
Captures a screenshot with custom options (context, origin, format, clip, save path). Read more
Source§fn emulate_timezone(
&mut self,
timezone: Option<String>,
) -> impl Future<Output = Result<(), EmulationError>> + Send
fn emulate_timezone( &mut self, timezone: Option<String>, ) -> impl Future<Output = Result<(), EmulationError>> + Send
Emulates a timezone for the active browsing context. Read more
Source§fn emulate_timezone_with_options(
&mut self,
timezone: Option<String>,
options: EmulateTimezoneOptions,
) -> impl Future<Output = Result<(), EmulationError>> + Send
fn emulate_timezone_with_options( &mut self, timezone: Option<String>, options: EmulateTimezoneOptions, ) -> impl Future<Output = Result<(), EmulationError>> + Send
Emulates a timezone with custom context and user context filters. Read more
Source§fn authenticate(
&mut self,
username: impl Into<String> + Send + 'static,
password: impl Into<String> + Send + 'static,
) -> impl Future<Output = Result<(), InterceptNetworkError>> + Send
fn authenticate( &mut self, username: impl Into<String> + Send + 'static, password: impl Into<String> + Send + 'static, ) -> impl Future<Output = Result<(), InterceptNetworkError>> + Send
Sets HTTP authentication credentials for all requests.
Source§fn authenticate_with_options(
&mut self,
username: impl Into<String> + Send + 'static,
password: impl Into<String> + Send + 'static,
options: AuthenticateOptions,
) -> impl Future<Output = Result<(), InterceptNetworkError>> + Send
fn authenticate_with_options( &mut self, username: impl Into<String> + Send + 'static, password: impl Into<String> + Send + 'static, options: AuthenticateOptions, ) -> impl Future<Output = Result<(), InterceptNetworkError>> + Send
Sets HTTP authentication credentials with URL pattern and context filters.
Source§fn mouse(&self) -> &BidiMouse<Self::Transport>
fn mouse(&self) -> &BidiMouse<Self::Transport>
Returns a reference to the direct BiDi mouse for precise, instant movements. Read more
Source§fn human_mouse(&self) -> &HumanMouse<BidiMouse<Self::Transport>>
fn human_mouse(&self) -> &HumanMouse<BidiMouse<Self::Transport>>
Returns a reference to the human mouse for realistic, human-like movements with Bezier curves and jitter. Read more
Source§fn keyboard(&self) -> &BidiKeyboard<Self::Transport>
fn keyboard(&self) -> &BidiKeyboard<Self::Transport>
Returns a reference to the keyboard for text input and key presses. Read more
fn touchscreen(&self) -> &Touchscreen<Self::Transport>
fn human_touchscreen(&self) -> &HumanTouchscreen<Self::Transport>
fn get_active_context_id(&self) -> Result<BrowsingContext, ContextIndexError>
Source§fn send_command(
&mut self,
command: Command,
) -> impl Future<Output = Result<CommandResponse, SessionSendError>> + Send
fn send_command( &mut self, command: Command, ) -> impl Future<Output = Result<CommandResponse, SessionSendError>> + Send
Sends a raw WebDriver BiDi command.
Source§fn end_session(
&mut self,
) -> impl Future<Output = Result<(), SessionSendError>> + Send
fn end_session( &mut self, ) -> impl Future<Output = Result<(), SessionSendError>> + Send
Ends the BiDi session and cleans up resources.
Auto Trait Implementations§
impl Freeze for FirefoxBrowser
impl !RefUnwindSafe for FirefoxBrowser
impl Send for FirefoxBrowser
impl Sync for FirefoxBrowser
impl Unpin for FirefoxBrowser
impl UnsafeUnpin for FirefoxBrowser
impl !UnwindSafe for FirefoxBrowser
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more