You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

为什么火狐浏览器不生效media.peerconnection.enabled配置选项?

问题原因

你定义了FirefoxOptions实例并配置了禁用WebRTC的参数,但没有将该实例传入webdriver.Firefox()的初始化参数中,导致所有自定义配置未被加载。

修复后代码

from seleniumwire import webdriver

options = webdriver.FirefoxOptions()
options.set_preference("media.peerconnection.enabled", False)

# 初始化驱动时传入options参数
driver = webdriver.Firefox(
    executable_path="geckodriver.exe",
    options=options
)
driver.get("https://iphey.com")

验证方法

启动驱动后进入about:config页面,搜索media.peerconnection.enabled,可看到配置值已变为预期的false。

内容的提问来源于stack exchange,提问作者subUser

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.05 17:15:02