搜尋 Mozilla 技術支援網站

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

Learn More

Issue in accesssing the current state for "allowed" or "denied" in Javascript code.

  • 無回覆
  • 1 有這個問題
  • 7 次檢視
more options

I was including code in javascript for asking the user about the location and the prompt is coming for asking the location and if now I console log with navigator.permission.query({name:geolocation}) then in state i am getting "prompt" which is fine but after allowing or denying i am not getting "allowed" or "denied" its still "prompt" but this things work fine in chrome. so is there any other object which is storing this state? for Mozilla or just Mozilla doesn't support this?

I was including code in javascript for asking the user about the location and the prompt is coming for asking the location and if now I console log with navigator.permission.query({name:geolocation}) then in state i am getting "prompt" which is fine but after allowing or denying i am not getting "allowed" or "denied" its still "prompt" but this things work fine in chrome. so is there any other object which is storing this state? for Mozilla or just Mozilla doesn't support this?