pub struct CreateTargetBuilder { /* private fields */ }Expand description
Builder for CreateTarget.
Implementations§
Source§impl CreateTargetBuilder
impl CreateTargetBuilder
Sourcepub fn url<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
pub fn url<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self
The initial URL the page will be navigated to. An empty string indicates about:blank.
Sourcepub fn left<VALUE: Into<JsUInt>>(&mut self, value: VALUE) -> &mut Self
pub fn left<VALUE: Into<JsUInt>>(&mut self, value: VALUE) -> &mut Self
Frame left origin in DIP (requires newWindow to be true or headless shell).
Sourcepub fn top<VALUE: Into<JsUInt>>(&mut self, value: VALUE) -> &mut Self
pub fn top<VALUE: Into<JsUInt>>(&mut self, value: VALUE) -> &mut Self
Frame top origin in DIP (requires newWindow to be true or headless shell).
Sourcepub fn width<VALUE: Into<JsUInt>>(&mut self, value: VALUE) -> &mut Self
pub fn width<VALUE: Into<JsUInt>>(&mut self, value: VALUE) -> &mut Self
Frame width in DIP (requires newWindow to be true or headless shell).
Sourcepub fn height<VALUE: Into<JsUInt>>(&mut self, value: VALUE) -> &mut Self
pub fn height<VALUE: Into<JsUInt>>(&mut self, value: VALUE) -> &mut Self
Frame height in DIP (requires newWindow to be true or headless shell).
Sourcepub fn window_state<VALUE: Into<WindowState>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn window_state<VALUE: Into<WindowState>>( &mut self, value: VALUE, ) -> &mut Self
Frame window state (requires newWindow to be true or headless shell). Default is normal.
Sourcepub fn browser_context_id<VALUE: Into<BrowserContextId>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn browser_context_id<VALUE: Into<BrowserContextId>>( &mut self, value: VALUE, ) -> &mut Self
The browser context to create the page in.
Sourcepub fn enable_begin_frame_control<VALUE: Into<bool>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn enable_begin_frame_control<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self
Whether BeginFrames for this target will be controlled via DevTools (headless shell only, not supported on MacOS yet, false by default).
Sourcepub fn new_window<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn new_window<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Whether to create a new Window or Tab (false by default, not supported by headless shell).
Sourcepub fn background<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn background<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Whether to create the target in background or foreground (false by default, not supported by headless shell).
Sourcepub fn for_tab<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn for_tab<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Whether to create the target of type “tab”.
Whether to create a hidden target. The hidden target is observable via protocol, but not
present in the tab UI strip. Cannot be created with forTab: true, newWindow: true or
background: false. The life-time of the tab is limited to the life-time of the session.
Sourcepub fn focus<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn focus<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
If specified, the option is used to determine if the new target should be focused or not. By default, the focus behavior depends on the value of the background field. For example, background=false and focus=false will result in the target tab being opened but the browser window remain unchanged (if it was in the background, it will remain in the background) and background=false with focus=undefined will result in the window being focused. Using background: true and focus: true is not supported and will result in an error.
Sourcepub fn build(&self) -> Result<CreateTarget, CreateTargetBuilderError>
pub fn build(&self) -> Result<CreateTarget, CreateTargetBuilderError>
Trait Implementations§
Source§impl Clone for CreateTargetBuilder
impl Clone for CreateTargetBuilder
Source§fn clone(&self) -> CreateTargetBuilder
fn clone(&self) -> CreateTargetBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more