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

Method apply_network_rules_internal

src/cdp.rs:387–397  ·  view source on GitHub ↗

Apply the current `blocklist` to a specific session via `Network.setBlockedURLs`. Used for both the persistent session and fallback per-command sessions (when the persistent one is unavailable).

(&mut self, session_id: &str)

Source from the content-addressed store, hash-verified

385 /// `Network.setBlockedURLs`. Used for both the persistent session and
386 /// fallback per-command sessions (when the persistent one is unavailable).
387 pub(crate) async fn apply_network_rules_internal(&mut self, session_id: &str) -> Result<()> {
388 self.send_to_target(session_id, "Network.enable", json!({}))
389 .await?;
390 self.send_to_target(
391 session_id,
392 "Network.setBlockedURLs",
393 json!({"urls": self.blocklist}),
394 )
395 .await?;
396 Ok(())
397 }
398
399 /// Drain accumulated network events from the persistent session.
400 pub fn drain_network_events(&mut self) -> Vec<Value> {

Callers 5

run_directFunction · 0.80
apply_network_rulesMethod · 0.80
emulateFunction · 0.80
execute_commandFunction · 0.80

Calls 1

send_to_targetMethod · 0.80

Tested by

no test coverage detected