Chrome浏览器Geolocation超时与W3C规范不符问题问询
The Core Problem
On Windows 7 64-bit running Chrome 66.0.3359.181, when calling the Geolocation API with a timeout parameter, a PositionError (error code 3, message "Timeout expired") is triggered after the timeout elapses—even if the user hasn't responded to the permission prompt at all.
But according to the W3C specification, the time spent waiting for user permission should not count toward the timeout duration. This parameter only applies to the actual location-fetching process after permission is granted.
Firefox 60 behaves correctly per the spec: it doesn't throw a timeout error while the user leaves the permission prompt unanswered.
Test Breakdown
Test Code
navigator.geolocation.getCurrentPosition( successCallback, errorCallback, { enableHighAccuracy: false, timeout: 10000, maximumAge: 1000 * 60 * 3 });
Test Steps
- Click the test option: "Strategie 2: getCurrentPosition {enableHighAccuracy: false, timeout:10000, maximumAge: 1000603}"
- Leave the permission popup unanswered and wait 10 seconds
Expected vs. Actual Results
- Expected: No action occurs (the permission prompt remains until the user makes a choice)
- Actual: Chrome triggers a timeout error; Firefox stays in the permission-waiting state with no error
Is This a Chrome Bug?
Absolutely—this behavior directly violates the W3C Geolocation API specification. Since you mentioned Chrome didn't act this way before, it's almost certainly a regression bug introduced in version 66.x.
If you want to push for a fix, you can report this issue on Chrome's official bug tracker (crbug.com), including your test details, browser version, and the contrast with Firefox's compliant behavior to help the dev team reproduce and address it quickly.
内容的提问来源于stack exchange,提问作者BenC

