Skip to content

Instantly share code, notes, and snippets.

View mikegilchrist's full-sized avatar

Michael A Gilchrist mikegilchrist

  • University of Tennessee
  • Knoxville, TN USA
View GitHub Profile
@micksmix
micksmix / remove_tmp_containers.py
Last active December 9, 2024 15:43
Removes temporary containers in firefox
#!/usr/bin/env python3
"""
This script is designed to help users find their Firefox profiles and create
a backup of the `containers.json` file, especially if they use the 'Temporary Containers' extension.
Once the user selects the desired profile using arrow keys, the script does the following:
1. Identifies and removes any 'Temporary Containers' entries (those starting with 'tmp') from the `containers.json` file.
2. Creates a backup of the original `containers.json` file. If a backup already exists, it appends a timestamp to the new backup to avoid overwrites.
3. Overwrites the `containers.json` file with the cleaned data.