為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Geolocation API doesn't work with sandboxed iframes or provide an error

more options

The navigator.geolocation.watchPosition function call doesn't work with sandboxed iframes where allow-same-origin is not specified (so the iframe counts as a unique and anonymous origin). I guess that making the sandboxed iframe not inherit the permission to use the the geolocation API of the site that contains is a sensible decision. Personally, I would like to have some way of creating sandboxed iframes that can also use the geolocation API but I can understand if that is not implemented. However, a sandboxed iframe also does not receive a permission error when it uses the geolocation API which is completely wrong and makes the situation really hard to debug.

Perhaps, the bug at https://bugzilla.mozilla.org/show_bug.cgi?id=675533 is related somehow?

The navigator.geolocation.watchPosition function call doesn't work with sandboxed iframes where allow-same-origin is not specified (so the iframe counts as a unique and anonymous origin). I guess that making the sandboxed iframe not inherit the permission to use the the geolocation API of the site that contains is a sensible decision. Personally, I would like to have some way of creating sandboxed iframes that can also use the geolocation API but I can understand if that is not implemented. However, a sandboxed iframe also does not receive a permission error when it uses the geolocation API which is completely wrong and makes the situation really hard to debug. Perhaps, the bug at https://bugzilla.mozilla.org/show_bug.cgi?id=675533 is related somehow?

被選擇的解決方法

I think this is beyond the scope of support. You might want to file a new bug and see how that goes: https://bugzilla.mozilla.org/

從原來的回覆中察看解決方案 👍 0

所有回覆 (1)

more options

選擇的解決方法

I think this is beyond the scope of support. You might want to file a new bug and see how that goes: https://bugzilla.mozilla.org/