-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Geolocation audit: warn if page is non-secure origin #1679
Conversation
throw new Error('Unable to determine if this permission was requested on page load ' + | ||
'because it had already been set. Try resetting the permission and running ' + | ||
'Lighthouse again.'); | ||
return options.driver.evaluateAsync('(function(){return window.isSecureContext;})()') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: isSecureContext
returns true for https://
and http://localhost
. The latter is a secure context for testing purposes. We may want to consider moving the HTTPs gatherer to this or supplementing it with this check for #1175.
.then(permissionState => { | ||
if (permissionState === 'granted' || permissionState === 'denied') { | ||
throw new Error('Unable to determine if the Geolocation permission was ' + | ||
'requested on page load because it was already granted/denied. ' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we have the permissionState
and we know it was either "granted" or "denied", should we just inject it into the string instead of saying "granted/denied"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🌍 🎯 🙅
R: all
Fixes #1676