Gemini Skill: Browser Testing for Local Files
This skill documents the rule for testing local HTML files using the browser agent in a remote environment.
Rule
Do not use file:/// URLs with the browser agent. They often fail due to access restrictions in remote or containerized environments.
Recommended Workflow
To allow the browser agent to view local HTML files:
Start a local web server in the directory containing the files. Example using Python:
python3 -m http.server 8000Note: Ensure the port is available. If not, try 8001, 8080, etc.
Access via localhost using the browser agent. URL:
http://localhost:8000/(or specific filename likeindex.html).
This allows the browser agent to render the page and take screenshots successfully.
Remember to Cleanup
Always kill the background server task when finished testing to free up the port!