Undetectable Firefox with Selenium
25 Apr 2026 📅 / 1 min ⏱️
Recently, I got interested in web scraping, but unfortunately, any major website using Cloudflare would instantly block my request. That’s how I learned that any browser under automation reports its state to any website. While browsing the internet, I found a patch for Firefox (https://github.com/bytexenon/undetected_geckodriver). The patch is very simple, and I didn’t want to add extra libraries, so I fit the entire patch into a single line:
sudo sed -i "s/webdriver/$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c 9; echo)/g" /usr/lib/firefox-esr/libxul.so
This script replaces the string webdriver in the libxul library, which reports the use of a driver, with 9 random characters. The patch does not affect the basic functionality of the driver - you can continue using Firefox without any issues.