You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Chrome浏览器Geolocation超时与W3C规范不符问题问询

Chrome vs Firefox: Geolocation Timeout Behavior Discrepancy (W3C Compliance Issue)

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 06:07:28