带有 CDN 结果的 Google Lighthouse cli

问题描述

我正在使用 lighthouse cli library 测试页面,结果比使用 lighthouse Chrome 扩展程序运行测试时差很多。

lighthouse https://www.luisaviaroma.com/en-gb/sw/men?lvrid=_gm --output html --only-categories=SEO --only-categories=performance --view 

原因是当我运行脚本时,我没有从 CDN 得到结果,而当我使用 chrome 扩展运行测试时,我得到了结果。这是因为在后一种情况下,我必须先访问网页,然后才能打开 Chrome 的开发工具并运行测试,该测试会重新加载网页,并从 CDN 返回结果。

当我运行 cli 脚本时,我还会收到以下警告:

“The page may not be loading as expected because your test URL (https://www.luisaviaroma.com/en-gb/sw/men?lvrid=_gm) was redirected to https://www.luisaviaroma.com/en-gb/sw/men?lvrid=_gm&aka_re=1. Try testing the second URL directly.”

问题:如何使用 google lighthouse cli 复制 CDN 结果?

我尝试过使用不同的 Chrome-flags 但没有成功。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)