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)
| 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> { |
no test coverage detected