-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Show a disabled geolocate button if user or system denies geolocation #8871
Conversation
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.
This looks good to me. How did you test on Safari? I just get an error that geolocation is disabled over http.
Another argument for adding an end-to-end test suite |
Could we update the title/aria-label when disabled to be something like "Location not available"? |
This is good! We should make sure to include a note in the changelog since the behaviour has changed. Anyone who prefers to hide the control when not available can still override the css |
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.
Could we update the title/aria-label when disabled to be something like "Location not available"?
I tested in Safari in the following way: brew install mkcert
mkcert -install
mkcert localhost
python -c "import BaseHTTPServer, SimpleHTTPServer, ssl; \
handler = SimpleHTTPServer.SimpleHTTPRequestHandler; \
httpd = BaseHTTPServer.HTTPServer(('localhost', 4443), handler); \
httpd.socket = ssl.wrap_socket(httpd.socket, \
certfile='./localhost.pem', \
keyfile='./localhost-key.pem', \
server_side=True); \
httpd.serve_forever()" Then accessed the server at |
f6f5941
to
625cbd2
Compare
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.
Added the title and aria-label, and addressed all review feedback.
Fixes #8870
This PR adds a new icon to be shown when the user or the system denied permission to use the location. It's shown when geolocation is disabled outright in Firefox and Chrome, or when the user or the system explicitly denies location after being prompted.
There are a few caveats:
Before this patch, the geolocate button was hidden when geolocation was disabled. It is now being shown, but in the new disabled state.
I'm a bit unsure how to test this correctly, since it depends on complex interaction between the OS, and the user clicking on various browser UIs.
/cc @andrewharvey