Struct headless_chrome::browser::context::Context
source · pub struct Context<'a> { /* private fields */ }
Expand description
Equivalent to a new incognito window
Implementations§
source§impl<'a> Context<'a>
impl<'a> Context<'a>
sourcepub fn new(browser: &'a Browser, context_id: String) -> Self
pub fn new(browser: &'a Browser, context_id: String) -> Self
Examples found in repository?
src/browser/mod.rs (line 277)
266 267 268 269 270 271 272 273 274 275 276 277 278
pub fn new_context(&self) -> Result<context::Context> {
debug!("Creating new browser context");
let context_id = self
.call_method(Target::CreateBrowserContext {
dispose_on_detach: None,
proxy_server: None,
proxy_bypass_list: None,
origins_with_universal_network_access: None,
})?
.browser_context_id;
debug!("Created new browser context: {:?}", context_id);
Ok(Context::new(self, context_id))
}