为Chrome扩展程序运行Lighthouse CLI

时间:2018-04-10 16:10:44

标签: google-chrome lighthouse

我正在开发chrome扩展,我想使用灯塔CLI进行审核。我发现从开发人员工具限制审计,因此我想使用灯塔CLI。

但是从命令行运行会产生错误

Abhisheks-MacBook-Pro:~ abhishekbatra$ lighthouse chrome-extension://hclbghnhiklgejahckgmpldjgfjhasdf/index.html
  ChromeLauncher Waiting for browser. +0ms
  ChromeLauncher Waiting for browser... +0ms
  ChromeLauncher Waiting for browser..... +511ms
  ChromeLauncher Waiting for browser.....✓ +2ms
  Lighthouse:warn The URL provided should be on HTTPS +367ms
  Lighthouse:warn Performance stats will be skewed redirecting from HTTP to HTTPS. +1ms
  status Initializing… +956ms
  status Loading page & waiting for onload URL, Scripts, CSSUsage, Viewport, ViewportDimensions, ThemeColor, Manifest, RuntimeExceptions, ChromeConsoleMessages, ImageUsage, Accessibility, EventListeners, AnchorsWithNoRelNoopener, AppCacheManifest, DOMStats, JSLibraries, OptimizedImages, PasswordInputsWithPreventedPaste, ResponseCompression, TagsBlockingFirstPaint, WebSQL, MetaDescription, FontSize, CrawlableLinks, MetaRobots, Hreflang, EmbeddedContent, Canonical, RobotsTxt, Fonts +358ms
  statusEnd Loading page & waiting for onload +6s
  status Retrieving trace +1ms
  status Retrieving devtoolsLog and network records +132ms
  GatherRunner:error FAILED_DOCUMENT_REQUEST chrome-extension://hclbghnhiklgejahckgmpldjgfjhasdf/index.html +2ms
  status Retrieving: URL +1ms
  status Retrieving: Scripts +0ms
 ...


  status Retrieving: Fonts +0ms
  status Loading page & waiting for onload ServiceWorker, Offline, StartUrl +310ms
  statusEnd Loading page & waiting for onload +29ms
  status Retrieving devtoolsLog and network records +0ms
  GatherRunner:error FAILED_DOCUMENT_REQUEST chrome-extension://hclbghnhiklgejahckgmpldjgfjhasdf/index.html +3ms
  status Retrieving: ServiceWorker +3ms
  status Retrieving: Offline +0ms
  status Retrieving: StartUrl +20ms
  status Loading page & waiting for onload HTTPRedirect, HTMLWithoutJavaScript +318ms
  statusEnd Loading page & waiting for onload +21ms
  status Retrieving devtoolsLog and network records +0ms
  GatherRunner:error FAILED_DOCUMENT_REQUEST chrome-extension://hclbghnhiklgejahckgmpldjgfjhasdf/index.html +1ms
  status Retrieving: HTTPRedirect +1ms
  status Retrieving: HTMLWithoutJavaScript +8ms
  status Disconnecting from browser... +3ms
  status Disconnecting from browser... +4ms
  CriConnection:warn disconnect() was called without an established connection. +0ms
  ChromeLauncher Killing Chrome instance 18449 +1ms
Runtime error encountered: Your page failed to load. Verify that the URL is valid and re-run Lighthouse.
LHError: FAILED_DOCUMENT_REQUEST
    at Function.getPageLoadError (/usr/local/lib/node_modules/lighthouse/lighthouse-core/gather/gather-runner.js:163:21)
    at pass.then._ (/usr/local/lib/node_modules/lighthouse/lighthouse-core/gather/gather-runner.js:298:36)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7)

检查Chrome扩展程序性能的任何其他方法。

0 个答案:

没有答案