pub struct Frame { /* private fields */ }Expand description
Puppeteer’s Frame (puppeteer-core 25.10.0), a remote object
served by browser-commander serve --stdio.
Extends EventEmitter; the inherited methods are repeated here.
Implementations§
Source§impl Frame
impl Frame
Sourcepub async fn on(
&self,
type_: Value,
handler: impl Into<JsFunction>,
) -> Result<Frame, BridgeError>
pub async fn on( &self, type_: Value, handler: impl Into<JsFunction>, ) -> Result<Frame, BridgeError>
EventEmitter.on
on<Key extends keyof EventsWithWildcard<Events>>(type: Key, handler: Handler<EventsWithWildcard<Events>[Key]>): thisSourcepub async fn off(
&self,
type_: Value,
handler: Option<JsFunction>,
) -> Result<Frame, BridgeError>
pub async fn off( &self, type_: Value, handler: Option<JsFunction>, ) -> Result<Frame, BridgeError>
EventEmitter.off
off<Key extends keyof EventsWithWildcard<Events>>(type: Key, handler?: Handler<EventsWithWildcard<Events>[Key]>): thisSourcepub async fn emit(
&self,
type_: Value,
event: Value,
) -> Result<bool, BridgeError>
pub async fn emit( &self, type_: Value, event: Value, ) -> Result<bool, BridgeError>
EventEmitter.emit
emit<Key extends keyof EventsWithWildcard<Events>>(type: Key, event: EventsWithWildcard<Events>[Key]): booleanSourcepub async fn once(
&self,
type_: Value,
handler: impl Into<JsFunction>,
) -> Result<Frame, BridgeError>
pub async fn once( &self, type_: Value, handler: impl Into<JsFunction>, ) -> Result<Frame, BridgeError>
EventEmitter.once
once<Key extends keyof EventsWithWildcard<Events>>(type: Key, handler: Handler<EventsWithWildcard<Events>[Key]>): thisSourcepub async fn listener_count(&self, type_: Value) -> Result<f64, BridgeError>
pub async fn listener_count(&self, type_: Value) -> Result<f64, BridgeError>
EventEmitter.listenerCount
listenerCount(type: keyof EventsWithWildcard<Events>): numberSourcepub async fn remove_all_listeners(
&self,
type_: Option<Value>,
) -> Result<Frame, BridgeError>
pub async fn remove_all_listeners( &self, type_: Option<Value>, ) -> Result<Frame, BridgeError>
EventEmitter.removeAllListeners
removeAllListeners(type?: keyof EventsWithWildcard<Events>): thisSourcepub async fn page(&self) -> Result<Page, BridgeError>
pub async fn page(&self) -> Result<Page, BridgeError>
Frame.page
page(): PageSourcepub async fn goto(
&self,
url: &str,
options: Option<Value>,
) -> Result<Option<HTTPResponse>, BridgeError>
pub async fn goto( &self, url: &str, options: Option<Value>, ) -> Result<Option<HTTPResponse>, BridgeError>
Frame.goto
goto(url: string, options?: GoToOptions): Promise<HTTPResponse | null>Frame.waitForNavigation
waitForNavigation(options?: WaitForOptions): Promise<HTTPResponse | null>Sourcepub async fn frame_element(&self) -> Result<Option<JSHandle>, BridgeError>
pub async fn frame_element(&self) -> Result<Option<JSHandle>, BridgeError>
Frame.frameElement
frameElement(): Promise<HandleFor<HTMLIFrameElement> | null>Sourcepub async fn evaluate_handle(
&self,
page_function: impl Into<JsFunction>,
args: &[Value],
) -> Result<JSHandle, BridgeError>
pub async fn evaluate_handle( &self, page_function: impl Into<JsFunction>, args: &[Value], ) -> Result<JSHandle, BridgeError>
Frame.evaluateHandle
evaluateHandle<Params extends unknown[], Func extends EvaluateFunc<Params> = EvaluateFunc<Params>>(pageFunction: Func | string, ...args: Params ): Promise<HandleFor<Awaited<ReturnType<Func>>>>Sourcepub async fn evaluate(
&self,
page_function: impl Into<JsFunction>,
args: &[Value],
) -> Result<Value, BridgeError>
pub async fn evaluate( &self, page_function: impl Into<JsFunction>, args: &[Value], ) -> Result<Value, BridgeError>
Frame.evaluate
evaluate<Params extends unknown[], Func extends EvaluateFunc<Params> = EvaluateFunc<Params>>(pageFunction: Func | string, ...args: Params ): Promise<Awaited<ReturnType<Func>>>Sourcepub async fn locator(
&self,
selector: impl Into<JsFunction>,
) -> Result<Locator, BridgeError>
pub async fn locator( &self, selector: impl Into<JsFunction>, ) -> Result<Locator, BridgeError>
Frame.locator
locator<Selector extends string>(selector: Selector): Locator<NodeFor<Selector>>
locator<Ret>(func: () => Awaitable<Ret>): Locator<Ret>Sourcepub async fn query_selector(
&self,
selector: &str,
) -> Result<Option<ElementHandle>, BridgeError>
pub async fn query_selector( &self, selector: &str, ) -> Result<Option<ElementHandle>, BridgeError>
Frame.$
$<Selector extends string>(selector: Selector): Promise<ElementHandle<NodeFor<Selector>> | null>Sourcepub async fn query_selector_all(
&self,
selector: &str,
options: Option<Value>,
) -> Result<Vec<ElementHandle>, BridgeError>
pub async fn query_selector_all( &self, selector: &str, options: Option<Value>, ) -> Result<Vec<ElementHandle>, BridgeError>
Frame.$$
$$<Selector extends string>(selector: Selector, options?: QueryOptions): Promise<Array<ElementHandle<NodeFor<Selector>>>>Sourcepub async fn eval_on_selector(
&self,
selector: &str,
page_function: impl Into<JsFunction>,
args: &[Value],
) -> Result<Value, BridgeError>
pub async fn eval_on_selector( &self, selector: &str, page_function: impl Into<JsFunction>, args: &[Value], ) -> Result<Value, BridgeError>
Frame.$eval
$eval<Selector extends string, Params extends unknown[], Func extends EvaluateFuncWith<NodeFor<Selector>, Params> = EvaluateFuncWith<NodeFor<Selector>, Params >>(selector: Selector, pageFunction: string | Func, ...args: Params ): Promise<Awaited<ReturnType<Func>>>Sourcepub async fn eval_on_selector_all(
&self,
selector: &str,
page_function: impl Into<JsFunction>,
args: &[Value],
) -> Result<Value, BridgeError>
pub async fn eval_on_selector_all( &self, selector: &str, page_function: impl Into<JsFunction>, args: &[Value], ) -> Result<Value, BridgeError>
Frame.$$eval
$$eval<Selector extends string, Params extends unknown[], Func extends EvaluateFuncWith<Array<NodeFor<Selector>>, Params> = EvaluateFuncWith<Array<NodeFor<Selector>>, Params>>(selector: Selector, pageFunction: string | Func, ...args: Params ): Promise<Awaited<ReturnType<Func>>>Sourcepub async fn wait_for_selector(
&self,
selector: &str,
options: Option<Value>,
) -> Result<Option<ElementHandle>, BridgeError>
pub async fn wait_for_selector( &self, selector: &str, options: Option<Value>, ) -> Result<Option<ElementHandle>, BridgeError>
Frame.waitForSelector
waitForSelector<Selector extends string>(selector: Selector, options?: WaitForSelectorOptions): Promise<ElementHandle<NodeFor<Selector>> | null>Sourcepub async fn wait_for_function(
&self,
page_function: impl Into<JsFunction>,
options: Option<Value>,
args: &[Value],
) -> Result<JSHandle, BridgeError>
pub async fn wait_for_function( &self, page_function: impl Into<JsFunction>, options: Option<Value>, args: &[Value], ) -> Result<JSHandle, BridgeError>
Frame.waitForFunction
waitForFunction<Params extends unknown[], Func extends EvaluateFunc<Params> = EvaluateFunc<Params>>(pageFunction: Func | string, options?: FrameWaitForFunctionOptions, ...args: Params ): Promise<HandleFor<Awaited<ReturnType<Func>>>>Sourcepub async fn content(&self) -> Result<String, BridgeError>
pub async fn content(&self) -> Result<String, BridgeError>
Frame.content
content(): Promise<string>Sourcepub async fn set_content(
&self,
html: &str,
options: Option<Value>,
) -> Result<(), BridgeError>
pub async fn set_content( &self, html: &str, options: Option<Value>, ) -> Result<(), BridgeError>
Frame.setContent
setContent(html: string, options?: SetContentWaitForOptions): Promise<void>Sourcepub async fn name(&self) -> Result<String, BridgeError>
pub async fn name(&self) -> Result<String, BridgeError>
Frame.name
name(): stringSourcepub async fn url(&self) -> Result<String, BridgeError>
pub async fn url(&self) -> Result<String, BridgeError>
Frame.url
url(): stringSourcepub async fn parent_frame(&self) -> Result<Option<Frame>, BridgeError>
pub async fn parent_frame(&self) -> Result<Option<Frame>, BridgeError>
Frame.parentFrame
parentFrame(): Frame | nullSourcepub async fn child_frames(&self) -> Result<Vec<Frame>, BridgeError>
pub async fn child_frames(&self) -> Result<Vec<Frame>, BridgeError>
Frame.childFrames
childFrames(): Frame[]Sourcepub async fn detached(&self) -> Result<bool, BridgeError>
pub async fn detached(&self) -> Result<bool, BridgeError>
Frame.detached
get detached(): booleanSourcepub async fn is_detached(&self) -> Result<bool, BridgeError>
pub async fn is_detached(&self) -> Result<bool, BridgeError>
Frame.isDetached
isDetached(): booleanSourcepub async fn add_script_tag(
&self,
options: Value,
) -> Result<ElementHandle, BridgeError>
pub async fn add_script_tag( &self, options: Value, ) -> Result<ElementHandle, BridgeError>
Frame.addScriptTag
addScriptTag(options: FrameAddScriptTagOptions): Promise<ElementHandle<HTMLScriptElement>>Sourcepub async fn add_style_tag(
&self,
options: Value,
) -> Result<ElementHandle, BridgeError>
pub async fn add_style_tag( &self, options: Value, ) -> Result<ElementHandle, BridgeError>
Frame.addStyleTag
addStyleTag(options: Omit<FrameAddStyleTagOptions, 'url'>): Promise<ElementHandle<HTMLStyleElement>>
addStyleTag(options: FrameAddStyleTagOptions): Promise<ElementHandle<HTMLLinkElement>>Sourcepub async fn click(
&self,
selector: &str,
options: Option<Value>,
) -> Result<(), BridgeError>
pub async fn click( &self, selector: &str, options: Option<Value>, ) -> Result<(), BridgeError>
Frame.click
click(selector: string, options?: Readonly<ClickOptions>): Promise<void>Sourcepub async fn focus(&self, selector: &str) -> Result<(), BridgeError>
pub async fn focus(&self, selector: &str) -> Result<(), BridgeError>
Frame.focus
focus(selector: string): Promise<void>Sourcepub async fn hover(&self, selector: &str) -> Result<(), BridgeError>
pub async fn hover(&self, selector: &str) -> Result<(), BridgeError>
Frame.hover
hover(selector: string): Promise<void>Sourcepub async fn select(
&self,
selector: &str,
values: &[&str],
) -> Result<Vec<String>, BridgeError>
pub async fn select( &self, selector: &str, values: &[&str], ) -> Result<Vec<String>, BridgeError>
Frame.select
select(selector: string, ...values: string[]): Promise<string[]>Sourcepub async fn tap(&self, selector: &str) -> Result<(), BridgeError>
pub async fn tap(&self, selector: &str) -> Result<(), BridgeError>
Frame.tap
tap(selector: string): Promise<void>Sourcepub async fn type(
&self,
selector: &str,
text: &str,
options: Option<Value>,
) -> Result<(), BridgeError>
pub async fn type( &self, selector: &str, text: &str, options: Option<Value>, ) -> Result<(), BridgeError>
Frame.type
type(selector: string, text: string, options?: Readonly<KeyboardTypeOptions>): Promise<void>Sourcepub async fn title(&self) -> Result<String, BridgeError>
pub async fn title(&self) -> Result<String, BridgeError>
Frame.title
title(): Promise<string>Sourcepub async fn extension_realms(&self) -> Result<Vec<Realm>, BridgeError>
pub async fn extension_realms(&self) -> Result<Vec<Realm>, BridgeError>
Frame.extensionRealms
extensionRealms(): Realm[]Trait Implementations§
Source§impl FromWire for Frame
impl FromWire for Frame
Source§fn from_wire(client: &BridgeClient, value: Value) -> Result<Self, BridgeError>
fn from_wire(client: &BridgeClient, value: Value) -> Result<Self, BridgeError>
Convert, failing with
BridgeError::Decode on a type mismatch.Source§impl Remote for Frame
impl Remote for Frame
Source§fn from_remote(remote: RemoteHandle) -> Self
fn from_remote(remote: RemoteHandle) -> Self
Wrap a handle without checking its type.
Source§fn remote(&self) -> &RemoteHandle
fn remote(&self) -> &RemoteHandle
The handle behind the wrapper.
impl StructuralPartialEq for Frame
Auto Trait Implementations§
impl !RefUnwindSafe for Frame
impl !UnwindSafe for Frame
impl Freeze for Frame
impl Send for Frame
impl Sync for Frame
impl Unpin for Frame
impl UnsafeUnpin for Frame
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
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