[cookies:firefox] extract only cookies without container by default (#5957)
add support for 'all' to extract all cookies regardless of container
This commit is contained in:
@@ -106,7 +106,7 @@
|
||||
optional domain prefixed with '/', keyring name
|
||||
prefixed with '+', profile prefixed with ':',
|
||||
and container prefixed with '::' ('none' for no
|
||||
container)
|
||||
container (default), 'all' for all containers)
|
||||
|
||||
## Selection Options:
|
||||
-A, --abort N Stop current extractor run after N consecutive
|
||||
|
||||
@@ -179,11 +179,14 @@ def _firefox_cookies_database(profile=None, container=None):
|
||||
"{}".format(search_root))
|
||||
_log_debug("Extracting cookies from %s", path)
|
||||
|
||||
if container == "none":
|
||||
if not container or container == "none":
|
||||
container_id = False
|
||||
_log_debug("Only loading cookies not belonging to any container")
|
||||
|
||||
elif container:
|
||||
elif container == "all":
|
||||
container_id = None
|
||||
|
||||
else:
|
||||
containers_path = os.path.join(
|
||||
os.path.dirname(path), "containers.json")
|
||||
|
||||
@@ -207,8 +210,6 @@ def _firefox_cookies_database(profile=None, container=None):
|
||||
container))
|
||||
_log_debug("Only loading cookies from container '%s' (ID %s)",
|
||||
container, container_id)
|
||||
else:
|
||||
container_id = None
|
||||
|
||||
return path, container_id
|
||||
|
||||
|
||||
@@ -526,7 +526,8 @@ def build_parser():
|
||||
"domain prefixed with '/', "
|
||||
"keyring name prefixed with '+', "
|
||||
"profile prefixed with ':', and "
|
||||
"container prefixed with '::' ('none' for no container)"),
|
||||
"container prefixed with '::' "
|
||||
"('none' for no container (default), 'all' for all containers)"),
|
||||
)
|
||||
|
||||
selection = parser.add_argument_group("Selection Options")
|
||||
|
||||
Reference in New Issue
Block a user