Chrome DevTools Protocol Browser.newContext with userDataDir: Persistence Across Unclean Shutdowns?
0 reputation · 16 Apr 2020, 18:21 UTC
Goal: Establish a repeatable development environment by launching Chrome through the DevTools Protocol's Browser.newContext method with a specified userDataDir so that cookies, localStorage, and extension state persist across restarts.
Uncertainty: Chrome’s internal cleanup routines may delete or modify files inside the userDataDir when it detects an unclean shutdown, profile corruption, or applies cache policies, and this behavior is not documented or exposed via a CDP endpoint, leaving no way to verify that the profile remained unchanged after a restart.
- Does Chrome guarantee that the
userDataDirremains unchanged after an unclean process termination? - Are there any CDP mechanisms or filesystem indicators that can signal profile corruption or cleanup activity?
- What specific directories or files (e.g., GPU cache, Cache, Code Cache) does Chrome prune during startup following a crash?