如何以编程方式禁用 Lighthouse 中的节流?
How to disable throttling in Lighthouse programmaticaly?
根据问题标题,在 NodeJS 中以编程方式使用 Lighthouse 时如何禁用任何限制?
这应该有所帮助:(在灯塔 2.9.4 上测试)
lhr = await lighthouse(url, {
port: (new URL(browser.wsEndpoint())).port,
output: 'json',
logLevel: 'info',
disableDeviceEmulation: true,
disableCpuThrottling: true,
disableNetworkThrottling: true
});
对于 v3,它不是这样工作的,但如此处所述
https://developers.google.com/web/tools/lighthouse/v3/migration
例如喜欢:
let opts = {
...
throttlingMethod: 'provided',
throttling: {
throughputKbps: 8000,
downloadThroughputKbps: 8000,
uploadThroughputKbps: 2000
}
};
根据问题标题,在 NodeJS 中以编程方式使用 Lighthouse 时如何禁用任何限制?
这应该有所帮助:(在灯塔 2.9.4 上测试)
lhr = await lighthouse(url, {
port: (new URL(browser.wsEndpoint())).port,
output: 'json',
logLevel: 'info',
disableDeviceEmulation: true,
disableCpuThrottling: true,
disableNetworkThrottling: true
});
对于 v3,它不是这样工作的,但如此处所述
https://developers.google.com/web/tools/lighthouse/v3/migration
例如喜欢:
let opts = {
...
throttlingMethod: 'provided',
throttling: {
throughputKbps: 8000,
downloadThroughputKbps: 8000,
uploadThroughputKbps: 2000
}
};