Intent to Ship: PermissionStatus.prototype.name

76 views
Skip to first unread message

Marcos Caceres

unread,
Aug 19, 2021, 11:54:21 AM8/19/21
to blink-dev
Contact emails

Explainer
N/A

Specification

API spec
Yes

Summary
Adds a new read only attribute "name" to the `PermissionStatus` interface, allowing the name of the permission to be gotten after a `PermissionStatus` is created.

Motivation
When querying multiple permissions simultaneously via the Permissions API, it was not possible to identify which PermissionStatus was which, as they were lacking a way to identify them (i.e., their "name"). The only way around this was to use something like array order or some other external index, which is less than ideal.

Blink component
Blink > PermissionsAPI

TAG review
Not required.

Risks
  Interoperability and Compatibility
  Can be feature-detected by checking for the existence of the PermissionStatus.prototype.name.

  Chrome: No public support (only personal support).

  Gecko: Implemented, shipped in Nightly https://bugzilla.mozilla.org/show_bug.cgi?id=1718021

  WebKit: No signal (don't Implement Permissions API)

  Web developers: None

Debuggability
No special support is needed.

Is this feature fully tested by web-platform-tests?
Yes, to the extent that it can be.

Flag name
N/A

Tracking bug

Link to entry on the Chrome Platform Status
Coming soon... 

Chris Harrelson

unread,
Aug 19, 2021, 5:29:42 PM8/19/21
to Marcos Caceres, blink-dev
On Thu, Aug 19, 2021 at 8:54 AM Marcos Caceres <mar...@marcosc.com> wrote:
Contact emails

Explainer
N/A

Specification

API spec
Yes

Summary
Adds a new read only attribute "name" to the `PermissionStatus` interface, allowing the name of the permission to be gotten after a `PermissionStatus` is created.

Motivation
When querying multiple permissions simultaneously via the Permissions API, it was not possible to identify which PermissionStatus was which, as they were lacking a way to identify them (i.e., their "name"). The only way around this was to use something like array order or some other external index, which is less than ideal.

Blink component
Blink > PermissionsAPI

TAG review
Not required.

I agree it's not required for this case, because it's so tiny and another browser has landed support.
 

Risks
  Interoperability and Compatibility
  Can be feature-detected by checking for the existence of the PermissionStatus.prototype.name.

  Chrome: No public support (only personal support).

  Gecko: Implemented, shipped in Nightly https://bugzilla.mozilla.org/show_bug.cgi?id=1718021

  WebKit: No signal (don't Implement Permissions API)

I agree there isn't much point in asking for a signal for this.
 

  Web developers: None

Can you find developer signals and link to them here? https://goo.gle/developer-signals
 

Debuggability
No special support is needed.

Is this feature fully tested by web-platform-tests?
Yes, to the extent that it can be.

Is there an issue preventing full testability?
 

Flag name
N/A

Tracking bug

Link to entry on the Chrome Platform Status
Coming soon... 

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/31cc4084-4ec7-4faf-abc4-1ea25f3fc6d9n%40chromium.org.

Mike Taylor

unread,
Aug 19, 2021, 6:41:55 PM8/19/21
to Marcos Caceres, blink-dev
Hey Marcos,

On 8/19/21 2:09 AM, Marcos Caceres wrote:
Tracking bug

I think that's maybe a mistake, https://bugs.chromium.org/p/chromium/issues/detail?id=1236856 seems to be the right bug.

later,
Mike


Marcos Caceres

unread,
Aug 19, 2021, 9:08:57 PM8/19/21
to Chris Harrelson, blink-dev

> On 20 Aug 2021, at 7:29 am, Chris Harrelson <chri...@chromium.org> wrote:
>
> Can you find developer signals and link to them here? https://goo.gle/developer-signals

Ah, thanks for that link! I thought "developers signals" had to be something different.

This is the original issues I filed (as a web developer):
https://github.com/w3c/permissions/issues/237#issue-863480652

Here are positive signals from various folks, which includes positive signals from folks at Mozilla:
https://github.com/w3c/permissions/pull/248

> Is this feature fully tested by web-platform-tests?
> Yes, to the extent that it can be.
>
> Is there an issue preventing full testability?

The feature just echo's the name of a permission that it is give (e.g. "geolocation"). However, not every browser implements every permission, so the WTP is restricted to interoperable permission names.

However, the fact that `.name` reflects the name of the query gives a fairly high assurance that the feature works as intended.

Marcos Caceres

unread,
Aug 19, 2021, 9:10:07 PM8/19/21
to Mike Taylor, blink-dev
Oh whoops! Copy/pasting is hard. Thanks, Mike!

Yoav Weiss

unread,
Aug 26, 2021, 3:40:03 AM8/26/21
to blink-dev, Marcos Caceres, blink-dev, Mike Taylor
LGTM1

This seems like a small and useful ergonomics fix, with very low risk. The developer signal for this is not very strong, but since we're following another vendor and it is a tiny addition, that seems fine.

Daniel Bratell

unread,
Aug 26, 2021, 8:50:59 AM8/26/21
to Yoav Weiss, blink-dev, Marcos Caceres, Mike Taylor

LGTM2

(And I'll second what Yoav said about developer signals; it is always preferable with some feedback, or shown interest or demand from the web developer community)

/Daniel

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Chris Harrelson

unread,
Aug 26, 2021, 11:11:03 AM8/26/21
to Daniel Bratell, Yoav Weiss, blink-dev, Marcos Caceres, Mike Taylor
Reply all
Reply to author
Forward
0 new messages