Closed Bug 2021892 Opened 8 months ago Closed 7 months ago

Make `navigator.permissions.query` aware of platform permission when appropriate

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement

Tracking

()

VERIFIED FIXED
151 Branch
Tracking Status
firefox150 + verified
firefox151 --- verified

People

(Reporter: saschanaz, Assigned: saschanaz)

References

Details

(Keywords: webcompat:platform-bug)

Attachments

(1 file, 7 external files)

15.75 KB, image/png
Details

Currently it fully depends on PermissionManager which is only aware of browser permissions, but it should return denied when OS denies the permission.

Component: Geolocation Provider → DOM: Core & HTML
Product: Toolkit → Core
Blocks: 2022043
Assignee: nobody → krosylight
Attachment #9551586 - Attachment description: WIP: Bug 2021892 - Make `navigator.permissions.query` aware of platform geolocation permission r=#dom-core → Bug 2021892 - Make `navigator.permissions.query` aware of platform geolocation permission r=#dom-core
Status: NEW → ASSIGNED
Pushed by krosylight@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/2078a41b1b88 https://hg.mozilla.org/integration/autoland/rev/824de4fa09ba Make `navigator.permissions.query` aware of platform geolocation permission r=jjaschke
Pushed by agoloman@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/40a731e04394 https://hg.mozilla.org/integration/autoland/rev/0757db69f359 Revert "Bug 2021892 - Make `navigator.permissions.query` aware of platform geolocation permission r=jjaschke" for causing mochitest failures.

Backed out for causing wpt and mochitest failures.

Flags: needinfo?(krosylight)
Attachment #9551586 - Attachment description: Bug 2021892 - Make `navigator.permissions.query` aware of platform geolocation permission r=#dom-core → Bug 2021892 - Part 1: Make `navigator.permissions.query` aware of platform geolocation permission r=jjaschke
Attachment #9552417 - Attachment description: WIP: Bug 2021892 - Part 2: Fix test to wait for permission status r=jjaschke → Bug 2021892 - Part 2: Fix test to wait for permission status r=jjaschke
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch
Regressions: 2023331
Flags: needinfo?(krosylight)
Status: RESOLVED → REOPENED
Flags: needinfo?(krosylight)
Resolution: FIXED → ---
Target Milestone: 150 Branch → ---

Should probably use PBackground instead for worker usage, PContent only supports main thread.

Flags: needinfo?(krosylight)

Issues navigator.permissions.query, for currently supported and unsupported
permissions, from a web worker. This checks that the call is thread safe
for workers.

Attachment #9555256 - Attachment description: Bug 2021892 - Part 3: Add test that web workers can safely access permissions r=jjaschke! → Bug 2021892 - Part 3: Add wpt test that web workers can safely access permissions r=jjaschke!
Attachment #9555256 - Attachment description: Bug 2021892 - Part 3: Add wpt test that web workers can safely access permissions r=jjaschke! → Bug 2021892 - Part 3: Make storage-access get permission in workers r=jjaschke!,saschanaz!
Status: REOPENED → RESOLVED
Closed: 8 months ago → 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 151 Branch
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/59177 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
QA Whiteboard: [qa-triage-done-c152/b151]
Attachment #9573040 - Flags: approval-mozilla-release?
Attachment #9573041 - Flags: approval-mozilla-release?
Attachment #9573042 - Flags: approval-mozilla-release?

firefox-release Uplift Approval Request

  • User impact if declined/Reason for urgency: People who granted geolocation permission in Google Maps but have not granted system permission to Firefox will get system prompt whenever they visit Google. See bug 2034518.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: yes
  • Steps to reproduce for manual QE testing: Please follow https://bugzilla.mozilla.org/show_bug.cgi?id=2034518#c0.
  • Risk associated with taking this patch: low
  • Explanation of risk level: Has already been in nightly and beta, the logic is relatively simple.
  • String changes made/needed?: N/A
  • Is Android affected?: no
Flags: qe-verify+

Henrik, you may also want to uplift the remote pref patch (and for macOS one too, we want to uplift that too).

Flags: needinfo?(hskupin)
Attachment #9573040 - Flags: approval-mozilla-release? → approval-mozilla-release+
Attachment #9573041 - Flags: approval-mozilla-release? → approval-mozilla-release+
Attachment #9573042 - Flags: approval-mozilla-release? → approval-mozilla-release+
QA Whiteboard: [qa-triage-done-c152/b151] → [uplift][qa-triage-done-c152/b151][qa-ver-needed-c152/b151]

The patch on bug 2031230 was already uplifted. Thank you for letting us know Kagami!

Flags: needinfo?(hskupin)

Reproduced the initial issues as described in Bug 2034518 Comment 0 using Nightly 151.0a1 (Build ID: 20260406213346) - system prompt and browser permission was requested when visiting Google.com.

Verified as fixed using Firefox 151.0b2 on Windows 11 and macOS 15 where the system prompt and the browser permissions were no longer requested when navigating to Google.com after accessing and giving browser permissions on Google maps.

However, I noticed that when using Firefox 151.0b2 on Ubuntu 24.04 - the Location permission is still visible in the Address Bar when navigating to Google.com after accessing and giving permissions on Google maps - please see the screenshot.

@Kagami Rosylight, is this behavior expected on Ubuntu 24.04? Could you please take a look?

Flags: needinfo?(krosylight)

We don't follow system permission on Linux right now, so it's expected currently. Thanks!

Edit: bug 2035203.

Flags: needinfo?(krosylight)

(In reply to Kagami Rosylight [:saschanaz] (they/them) from comment #26)

We don't follow system permission on Linux right now, so it's expected currently. Thanks!

Thank you !
Based on this and on Comment 25, I'm setting the status for firefox151 to verified.

QA Contact: sbadau

Verified as fixed using Firefox 150.0.1 (Build ID: 20260427013024) on Windows 11 and macOS 15 - system prompt and the browser permissions are no longer requested when navigating to Google.com after accessing and giving browser permissions on Google maps.

Status: RESOLVED → VERIFIED
QA Whiteboard: [uplift][qa-triage-done-c152/b151][qa-ver-needed-c152/b151] → [uplift][qa-triage-done-c152/b151][qa-ver-done-c152/b151]
Flags: qe-verify+
Regressions: 2036484
See Also: → 2048776
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: