Fix: Keep storage_state.json in profile shrink
- Add storage_state.json to all KEEP_PATTERNS levels - This file contains unencrypted cookies in Playwright format - Critical for cross-machine profile portability (local -> cloud)
This commit is contained in:
@@ -37,21 +37,23 @@ class ShrinkLevel(str, Enum):
|
|||||||
|
|
||||||
# Whitelist: what to KEEP at each level (everything else gets deleted)
|
# Whitelist: what to KEEP at each level (everything else gets deleted)
|
||||||
# Note: "Cookies" can be at root (older Chrome) or in Network/ (Chrome 96+)
|
# Note: "Cookies" can be at root (older Chrome) or in Network/ (Chrome 96+)
|
||||||
|
# storage_state.json is Playwright's portable cookie format (unencrypted)
|
||||||
|
# It MUST be kept in all levels for cross-machine profile portability
|
||||||
KEEP_PATTERNS: Dict[ShrinkLevel, Set[str]] = {
|
KEEP_PATTERNS: Dict[ShrinkLevel, Set[str]] = {
|
||||||
ShrinkLevel.NONE: {"*"},
|
ShrinkLevel.NONE: {"*"},
|
||||||
ShrinkLevel.LIGHT: {
|
ShrinkLevel.LIGHT: {
|
||||||
"Network", "Cookies", "Local Storage", "Session Storage", "IndexedDB",
|
"Network", "Cookies", "Local Storage", "Session Storage", "IndexedDB",
|
||||||
"Preferences", "Secure Preferences", "Login Data", "Login Data For Account",
|
"Preferences", "Secure Preferences", "Login Data", "Login Data For Account",
|
||||||
"Web Data", "History", "History-journal", "Visited Links", "Bookmarks",
|
"Web Data", "History", "History-journal", "Visited Links", "Bookmarks",
|
||||||
"TransportSecurity", "Trust Tokens",
|
"TransportSecurity", "Trust Tokens", "storage_state.json",
|
||||||
},
|
},
|
||||||
ShrinkLevel.MEDIUM: {
|
ShrinkLevel.MEDIUM: {
|
||||||
"Network", "Cookies", "Local Storage", "Session Storage", "IndexedDB",
|
"Network", "Cookies", "Local Storage", "Session Storage", "IndexedDB",
|
||||||
"Preferences", "Secure Preferences", "Login Data", "Login Data For Account",
|
"Preferences", "Secure Preferences", "Login Data", "Login Data For Account",
|
||||||
"Web Data", "TransportSecurity",
|
"Web Data", "TransportSecurity", "storage_state.json",
|
||||||
},
|
},
|
||||||
ShrinkLevel.AGGRESSIVE: {"Network", "Cookies", "Local Storage", "IndexedDB", "Preferences"},
|
ShrinkLevel.AGGRESSIVE: {"Network", "Cookies", "Local Storage", "IndexedDB", "Preferences", "storage_state.json"},
|
||||||
ShrinkLevel.MINIMAL: {"Network", "Cookies", "Local Storage"},
|
ShrinkLevel.MINIMAL: {"Network", "Cookies", "Local Storage", "storage_state.json"},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user