MCPcopy Create free account
hub / github.com/aeroxy/chrome-devtools-cli / create_target

Method create_target

src/cdp.rs:741–749  ·  view source on GitHub ↗

Create a new page target and return its target ID.

(&mut self, url: &str)

Source from the content-addressed store, hash-verified

739
740 /// Create a new page target and return its target ID.
741 pub async fn create_target(&mut self, url: &str) -> Result<String> {
742 let result = self
743 .send("Target.createTarget", json!({"url": url}))
744 .await?;
745 result["targetId"]
746 .as_str()
747 .map(|s| s.to_string())
748 .ok_or_else(|| anyhow!("No targetId in createTarget response"))
749 }
750
751 /// Close a target by its target ID.
752 pub async fn close_target(&mut self, target_id: &str) -> Result<()> {

Callers 1

new_pageFunction · 0.80

Calls 1

sendMethod · 0.45

Tested by

no test coverage detected