Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass parameters to beforePass #10972

Closed
htr751 opened this issue Jun 16, 2020 · 4 comments
Closed

Pass parameters to beforePass #10972

htr751 opened this issue Jun 16, 2020 · 4 comments

Comments

@htr751
Copy link

htr751 commented Jun 16, 2020

I would like to pass parameters to my custom gatherers but I can't find how to do it. Is there any way to do so? If not is there an alternative to pass data to it?

@patrickhulce
Copy link
Collaborator

Thanks for filing @htr751! Would you mind explaining a little more of your use case? What parameters do you want to pass? Where are they coming from?

@htr751
Copy link
Author

htr751 commented Jun 17, 2020

I wanted to pass some script (as a string) so I will be able to evaluate it in the context of the tested site. thought about passing it when I call lighthouse with the url of the site.

@patrickhulce
Copy link
Collaborator

well you have full control over your custom gatherer so you have plenty of options here just as you would with any other node code.

you could...

  • read arguments from process.argv and find a custom flag you use
  • read from local filesystem using fs
  • read from environment variables using process.env

When you don't need to bundle the gatherer for the browser like we do in core you have a lot of flexibility here :)

Proper support for gatherer options is tracked by #10247

@patrickhulce
Copy link
Collaborator

We consider this problem solved by the options outlined in #10972 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants