Expose page functions to custom gatherers
See original GitHub issueProvide the steps to reproduce
- Run LH on https://bristololdvic.org.uk with my massive wrapper function and custom gatherer/audit library…
What is the current behavior?
Got a custom audit to test for http status code- snippet below.
const mainResource = await artifacts.requestMainResource({URL: artifacts.URL, devtoolsLog});
const statusCode = mainResource.statusCode;
if (statusCode >= 500 && statusCode < 600) {
return {
rawValue: false,
displayValue: `Page returned HTTP status code of ${statusCode}`,
};
}
return {
rawValue: true,
displayValue: `Page returned HTTP status code of ${statusCode}`,
};
What happens is artifacts.requestMainResource({URL: artifacts.URL, devtoolsLog})
rejects with TypeError: devtoolsLog.forEach is not a function
This is nothing to do with the arguments I pass in to the method; I have a feeling the issue is with https://github.com/GoogleChrome/lighthouse/blob/1098f952d5c75b22668aa572532415f81d2817af/lighthouse-core/lib/network-recorder.js#L355
The rejection of this promise then exits this function prematurely, and rawValue will be null
which isn’t handy for further use!
What is the expected behavior?
Expected behaviour is artifacts.requestMainResource({URL: artifacts.URL, devtoolsLog})
to resolve, returning the main resource so it’s parameters can be used for tests in audits.
Environment Information
- Affected Channels:
- Lighthouse version: lighthouse@2.9.4
- Node.js version: v10.14.1
- Operating System: Windows 10 Home
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (1 by maintainers)
Top Results From Across the Web
INFORMATION AND ITS ROLE IN HUNTER-GATHERER ...
Information and Its Role in Hunter-Gatherer Bands, edited by. Robert Whallon, William A. Lovis, and Robert K. Hitchcock. Volume 4.
Read more >prometheus - The Go Programming Language - GitHub Pages
With a custom registry, you are in control and decide yourself about the Collectors to register. HTTP Exposition. The Registry implements the Gatherer...
Read more >Creating a Google Lighthouse custom audit that checks DOM ...
This article covers creating a Lighthouse custom audit and gatherer to perform checks against DOM elements.
Read more >From Hunters And Gatherers To Farmers Worksheet | Cerritos ...
This worksheet was from hunters would you white man have trouble focusing or farmer. First, in restricting the transfer of ownership interests, ...
Read more >Custom installation — pgwatch2 documentation - Read the Docs
For use cases where exposing the component (Grafana, Postgres, Influx, gatherer daemon, Web UI itself) logs over the “/logs” endpoint remotely is wanted,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@upugo-dev should be AFAIK
That makes a lot of sense, thanks for following up.