pub struct CreateTargetParams<'a> { /* private fields */ }Expand description
Creates a new page.
Implementations§
Source§impl<'a> CreateTargetParams<'a>
impl<'a> CreateTargetParams<'a>
Sourcepub fn builder(url: impl Into<Cow<'a, str>>) -> CreateTargetParamsBuilder<'a>
pub fn builder(url: impl Into<Cow<'a, str>>) -> CreateTargetParamsBuilder<'a>
Creates a builder for this type with the required parameters:
url: The initial URL the page will be navigated to. An empty string indicates about:blank.
Sourcepub fn url(&self) -> &str
pub fn url(&self) -> &str
The initial URL the page will be navigated to. An empty string indicates about:blank.
Sourcepub fn left(&self) -> Option<i64>
pub fn left(&self) -> Option<i64>
Frame left origin in DIP (requires newWindow to be true or headless shell).
Sourcepub fn top(&self) -> Option<i64>
pub fn top(&self) -> Option<i64>
Frame top origin in DIP (requires newWindow to be true or headless shell).
Sourcepub fn width(&self) -> Option<u64>
pub fn width(&self) -> Option<u64>
Frame width in DIP (requires newWindow to be true or headless shell).
Sourcepub fn height(&self) -> Option<i64>
pub fn height(&self) -> Option<i64>
Frame height in DIP (requires newWindow to be true or headless shell).
Sourcepub fn window_state(&self) -> Option<&WindowState>
pub fn window_state(&self) -> Option<&WindowState>
Frame window state (requires newWindow to be true or headless shell). Default is normal.
Sourcepub fn browser_context_id(&self) -> Option<&BrowserContextID<'a>>
pub fn browser_context_id(&self) -> Option<&BrowserContextID<'a>>
The browser context to create the page in.
Sourcepub fn enable_begin_frame_control(&self) -> Option<bool>
pub fn enable_begin_frame_control(&self) -> Option<bool>
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(&self) -> Option<bool>
pub fn new_window(&self) -> Option<bool>
Whether to create a new Window or Tab (false by default, not supported by headless shell).
Sourcepub fn background(&self) -> Option<bool>
pub fn background(&self) -> Option<bool>
Whether to create the target in background or foreground (false by default, not supported by headless shell).
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(&self) -> Option<bool>
pub fn focus(&self) -> Option<bool>
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.
Trait Implementations§
Source§impl<'a> CdpCommand<'a> for CreateTargetParams<'a>
impl<'a> CdpCommand<'a> for CreateTargetParams<'a>
Source§impl<'a> Clone for CreateTargetParams<'a>
impl<'a> Clone for CreateTargetParams<'a>
Source§fn clone(&self) -> CreateTargetParams<'a>
fn clone(&self) -> CreateTargetParams<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more