This tool automates running browser extensions in a sandboxed Chromium environment to safely test and interact with them without risking real user data.
Run a browser extension in a sandboxed web browser and without any fear of corrupting or loosing your real data.
This script is primarily used by software engineers, QA engineers, product owners, and cybersecurity professionals to safely test, demonstrate, and automate interactions with browser extensions in isolated environments. It enables unit testing, quality control, security testing, and demonstration of browser extensions like MetaMask without affecting the user's main browser data.
Playwright currently only supports Chromium browser extensions, so this tool is limited to Chromium-based browsers. Users should reinstall Chromium after updating Playwright dependencies. To update an extension in a session, delete the existing 'browser_extension' directory inside the session folder and rerun the script. This tool is intended for educational and testing purposes and may require modification to support other extensions beyond MetaMask.
Install required Python packages: pip3 install -r requirements.txt
Install Chromium browser for Playwright: playwright install chromium
Ensure to reinstall Chromium after Playwright upgrades
Install MetaMask extension in your main Chrome browser
Run the automation script: python3 automation.py
python3 automation.py
Run the script to open a sandboxed browser with the loaded extension.
python3 automation.py -s my_automation_session
Set up and use a sandboxed environment with a specified user session directory.
python3 automation.py -s my_automation_session -e dist --dev
Manually load an unpacked browser extension from the 'dist' directory in development mode.