Firefox, like Chrome, supports network throttling.
But the Geckodriver developers still haven't added an API to manage these network settings (unlike the Chromedriver developers)
Although there are network.http.throttle.*
items in the about:config
settings, they do not do what we might expect by looking at their name. I checked it by turning on these options, and they did not interfere with watching YouTube with 4K quality.
The same is written about these settings here.
Are there currently any ways to enable throttling in Firefox using Selenium or is it not possible?
P.S. I tried to add throttling like this and it didn't work:
firefox_profile = FirefoxProfile()
firefox_profile.set_preference("network.http.throttle.enable", True)
firefox_profile.set_preference("network.http.throttle.version", 1)
firefox_profile.set_preference("network.http.throttle.suspend-for", 900)
firefox_profile.set_preference("network.http.throttle.resume-for", 100)
firefox_profile.set_preference("network.http.throttle.hold-time-ms", 800)
firefox_profile.set_preference("network.http.throttle.max-time-ms", 500)
driver = Firefox(
executable_path=WEBDRIVER_PATH,
firefox_profile=firefox_profile,
)