使用响应式设计预设创建 Firefox 配置文件
Creating Firefox profile with responsive design preset
我是移动自动化的新手。如何创建带有响应式设计预设的 Firefox 配置文件?
您需要设置 devtools.responsiveUI.presets
firefox 首选项。
示例,使用 Python:
import json
from selenium import webdriver
presets = [
{
"key": "480x800",
"name": "Google Nexus one",
"width": 480,
"height": 800
},
# TO FILL
{
"key": "1680x1050",
"name": "Desktop - stat 2.96%",
"width": 1680,
"height": 1050
}
]
profile = webdriver.FirefoxProfile()
profile.set_preference('devtools.responsiveUI.presets', json.dumps(presets))
driver = webdriver.Firefox(profile)
另请参阅:
我是移动自动化的新手。如何创建带有响应式设计预设的 Firefox 配置文件?
您需要设置 devtools.responsiveUI.presets
firefox 首选项。
示例,使用 Python:
import json
from selenium import webdriver
presets = [
{
"key": "480x800",
"name": "Google Nexus one",
"width": 480,
"height": 800
},
# TO FILL
{
"key": "1680x1050",
"name": "Desktop - stat 2.96%",
"width": 1680,
"height": 1050
}
]
profile = webdriver.FirefoxProfile()
profile.set_preference('devtools.responsiveUI.presets', json.dumps(presets))
driver = webdriver.Firefox(profile)
另请参阅: