เหตุ
navigator.geolocation
เริ่มงอแงไม่ถามหา permission สำหรับ Chrome ใหม่ๆ (v50+)
ค้นพบ
getCurrentPosition() and watchPosition() are deprecated on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.
มันเริ่มจะกลายเป็นว่า ต้องเป็น secure origin ถึงจะ request ข้อมูลดังนี้ได้
- Geolocation — requires secure origins as of M50
- Device motion / orientation
- EME
- getUserMedia
- AppCache
แล้วอะไรคือ insecured origin
- localhost
- และ HTTP ธรรมดา…
แก้ไง?
เอ่อ ใช้ valid certificate ทำเป็น HTTPS ครัชชชชช