1

我正在开发一个 chrome 扩展,我想使用 lighthouse CLI 对其进行审核。我发现开发人员工具的审计受到限制,因此我想使用 lighthouse 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 扩展程序性能的方法。

4

0 回答 0