Smart Downloads Manager is a Chrome extension that allows users to manage their downloads efficiently by assigning file lifespans and interacting with native scripts to automate tasks such as deleting specific files. The extension uses Chrome's Native Messaging API to communicate with a Python script running locally.
- Set file lifespans for downloaded files.
- Delete specific files from the Downloads folder directly through the extension.
- Cross-platform support for Windows and macOS.
- Easy setup with an installer for both platforms.
-
Download the Repository
- Clone or download this repository.
-
Run the Installer
- Navigate to the
installerfolder in the project. - Double-click
installer.batto execute the installer.
- Navigate to the
-
What the Installer Does
- Locates your Python installation.
- Configures the
run.batfile with the correct paths. - Updates the
smartdownloadsmanager.jsonfile with the correct paths. - Adds a registry key for Chrome's Native Messaging Host.
-
Upload the Extension
- Navigate to
chrome://extensionsin Chrome. - Enable Developer Mode and select "Load Unpacked Extension."
- Upload the
chromeExtensionfolder. - Note the Extension ID and manually add it to the
smartdownloadsmanager.jsonfile under theallowed_originskey.
- Navigate to
-
Verify Installation
- Check the installation log at
installer/install.logfor any errors. - Confirm that the extension can communicate with the native Python script by pressing the "Test Communication" button in the extension popup.
- Check the installation log at
-
Download the Repository
- Clone or download this repository.
-
Run the Installer
- Open a terminal and navigate to the
installerfolder in the project. - Run the following commands:
chmod +x installer.sh ./installer.sh
- Open a terminal and navigate to the
-
What the Installer Does
- Locates your Python installation.
- Configures the
run.shfile with the correct paths. - Updates the
smartdownloadsmanager.jsonfile with the correct paths. - Places the JSON file in
~/Library/Application Support/Google/Chrome/NativeMessagingHosts/.
-
Upload the Extension
- Navigate to
chrome://extensionsin Chrome. - Enable Developer Mode and select "Load Unpacked Extension."
- Upload the
chromeExtensionfolder. - Note the Extension ID and manually add it to the
smartdownloadsmanager.jsonfile under theallowed_originskey.
- Navigate to
-
Verify Installation
- Check the installation log at
installer/install.logfor any errors. - Confirm that the extension can communicate with the native Python script by pressing the "Test Communication" button in the extension popup.
- Check the installation log at
- chromeExtension/
- Contains the Chrome extension files, such as
manifest.json,popup.html,popup.js, and supporting files.
- Contains the Chrome extension files, such as
- NativeMessaging/
run.bat(Windows) orrun.sh(macOS): Used to execute the Python script.smartdownloadsmanager.json: Configures the Native Messaging Host.
- installer/
installer.bat: Sets up the project on Windows.installer.sh: Sets up the project on macOS.install.log: Logs the installation progress and errors.
- python.py
- The Python script that handles commands from the extension.
-
Install the Chrome Extension
- Load the extension manually by enabling Developer Mode in Chrome and selecting "Load Unpacked Extension."
- Point to the
chromeExtensionfolder. - Navigate to
installer/installer.bator.shand run the file.
-
Test Communication
- Open the extension popup and press the "Test Communication" button.
- If the setup is successful, you should see a success response in the popup.
-
Delete a File
- Enter the filename (from the Downloads folder) in the "Test Delete File" field in the popup.
- Press the "Test Delete File" button to delete the file.
-
Native Messaging Host Not Found
- Verify that the JSON file is correctly placed:
- Windows:
HKEY_CURRENT_USER\Software\Google\Chrome\NativeMessagingHosts\smartdownloadsmanager - macOS:
~/Library/Application Support/Google/Chrome/NativeMessagingHosts/smartdownloadsmanager.json
- Windows:
- Verify that the JSON file is correctly placed:
-
Python Script Not Running
- Ensure that Python is installed and added to the PATH.
- Check the paths in
run.bat(Windows) orrun.sh(macOS).
-
Logs
- Check
install.login theinstallerfolder for errors. - Check
log.txtin the project root for runtime logs.
- Check
This project is licensed under the MIT License.

