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

Adds auto-requested geolocation audit #510

Merged
merged 5 commits into from
Jul 26, 2016
Merged

Adds auto-requested geolocation audit #510

merged 5 commits into from
Jul 26, 2016

Conversation

paullewis
Copy link
Contributor

Ref: https://developers.google.com/web/fundamentals/getting-started/principles/usability-and-form-factor?hl=en#be-clear-why-you-need-a-users-location

This adds an audit for pages that automatically request geolocation on load. It's a proto for getUserMedia and push messages, both of which should also not be requested outside of user interactions.

@@ -76,3 +76,6 @@ Artifacts.prototype.Speedline;

/** @type {{scrollWidth: number, viewportWidth: number}} */
Artifacts.prototype.ContentWidth;

/** @type {boolean} */
Artifacts.prototype.Geolocation;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more descriptive name for this? GeolocationOnStartup or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@brendankenny
Copy link
Member

reviewed!

@paullewis
Copy link
Contributor Author

Rebased and comments addressed. PTAL.

@paulirish
Copy link
Member

This wfm, but will defer to brendan

* represents a poor user experience, since it lacks context. As such, if the page requests
* geolocation the gatherer will intercept the call and mark a boolean flag to true. The audit that
* corresponds with this gatherer then checks for the flag.
* @author Paul Lewis
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lulz

@brendankenny
Copy link
Member

🌏 🌍 🔭 🚫

}

function collectGeoState() {
__returnResults(window.__didNotCallGeo);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paullewis: fyi, @paulirish removed the timeout in the last commit since evaluateAsync is already async and afterPass should only be called once all possible load listeners are called. Should automatically cover any expanded trace time when/if we extend the tracing time to e.g. better test TTI

@brendankenny brendankenny merged commit 60a06c5 into master Jul 26, 2016
@brendankenny brendankenny deleted the geolocation branch July 26, 2016 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants