alfa icon indicating copy to clipboard operation
alfa copied to clipboard

Support specifying user preferences in the CLI

Open kasperisager opened this issue 5 years ago • 3 comments

With #259, user preferences are supported as device parameters. However, there's not yet a way of specifying user preferences when working with the CLI. This could be done using a --preference flag that works similarly to the --header and --cookie flags. As such, one could do the following to audit a page with reduced motion enabled:

$ alfa audit --preference prefers-reduced-motion:reduce <url>

Another option is having each feature be a flag of its own:

$ alfa audit --prefers-reduced-motion <url>

This could lead to a lot of additional flags being added so I'm learning more towards the first approach.

kasperisager avatar Jun 10 '20 11:06 kasperisager

I'm also in favour of the first approach.

Jym77 avatar Jun 10 '20 11:06 Jym77

The nail in the coffin of the second approach is also that it couples the CLI to the available user preferences, which would not be the case with the first approach.

kasperisager avatar Jun 10 '20 12:06 kasperisager

We'll go with the first approach so this should mostly be a matter of duplicating the existing functionality for headers and cookies.

kasperisager avatar Feb 09 '21 08:02 kasperisager