1

根据问题标题,如何在 NodeJS 中以编程方式使用 Lighthouse 时禁用任何限制?

4

2 回答 2

4

对于 v3,它不是这样工作的,但如此处所述

https://developers.google.com/web/tools/lighthouse/v3/migration

例如:

let opts = {
    ...
    throttlingMethod: 'provided',
    throttling: {   
        throughputKbps: 8000,
        downloadThroughputKbps: 8000,
        uploadThroughputKbps: 2000
    }
};
于 2019-04-25T13:26:04.063 回答
1

这应该会有所帮助:(在灯塔 2.9.4 上测试)

 lhr = await lighthouse(url, {
  port: (new URL(browser.wsEndpoint())).port,
  output: 'json',
  logLevel: 'info',

  disableDeviceEmulation: true, 
  disableCpuThrottling: true, 
  disableNetworkThrottling: true

});
于 2018-06-20T21:29:25.623 回答