GoogleChromeLabs / ps-analysis-tool

Privacy Sandbox Analysis Chrome Extension and CLI for analysis and understanding of cookie usage on web pages, and new privacy-preserving Chrome APIs
https://www.privacysandbox.com
Apache License 2.0
100 stars 23 forks source link

Add the capability for the CLI handle pages with server errors #801

Open fellyph opened 2 months ago

fellyph commented 2 months ago

Feature Request

Description: Some URLs can return a server error. With the current version of the CLI, the audit continues without any alert, and using the CLI, the user cannot see if the audited URL has returned some error. Some error pages could use cookies for tracking. However, to simplify the audit process, when a URL returns an error, the CLI can skip extra steps from the audit.

This feature requests a warning to notify the user the report was taken from an error page, and observing the CLI over the error page, some steps could be skipped when an error page is analyzed, such as waiting 10 seconds to load the page completely and looking for a GDPR banner.

The CLI has three different scenarios where this functionally should handle with different strategies:

Some errors page to be considered to create a warning:

The report should be created when the audit is running for a list of URLs that still have some valid URLs. In this case, the CLI should create a report file; for URLs with an error, the CLI should warn the user about it. Currently, the dashboard has a component to display warnings for zero cookies pages, it can be reused to notify the server error response warning.

Screenshot 2024-08-12 at 12 07 45

Audit process

If the server returns an error, skip the last steps from the audit:

Screenshot 2024-08-12 at 12 44 32

For the list of URLs such as, csv and sitemaps, the user should be notified but the audit should continue looking for valid URLs.

Motivation: Avoid giving false positives to users. When the server returns an error, notify the users with a warning to provide feedback with the report that can be affected by the error returned by the server.

User Story: As a user, I want to get feedback from server errors so that I can understand the data returned more clearly.

Acceptance Criteria:

Related : #802

fellyph commented 2 months ago

@amedina suggested skipping the audit if the server returns an error.

fellyph commented 2 months ago

When the user audits a sitemap URL that returns a 404 error, the CLI continues the audit and generates a report with a white screen:

Screenshot 2024-08-19 at 16 45 41

We should include the verification for server errors for webpages and sitemaps