Intent to Implement and Ship: "persistent-storage" support for Permission API's query() method

48 views
Skip to first unread message

Joshua Bell

unread,
Aug 28, 2018, 7:32:27 PM8/28/18
to blink-dev

Contact emails

jsb...@chromium.org


Summary

The Storage API [1] and Permissions API [2] define the "persistent-storage" enum value for the set of permissions that can be used with the Permission API. This is not a new permission/capability - it can already be queried with navigator.storage.persisted(), but with this change navigator.permissions.query({name:"persistent-storage"}) can be used as well.

[1] https://storage.spec.whatwg.org/ [2] https://w3c.github.io/permissions

Tracking bug: https://crbug.com/878525


Motivation

There should be a uniform method of querying a permission's state. The Storage spec also gives examples using the API.


Risks

Interoperability and Compatibility

No compat risk.


Edge: No signals (storage API not supported)

Firefox: Shipped

Safari: No signals (storage API not supported)

Web developers: Unknown


Ergonomics

This bridges the Storage API and Permissions API, as is done for other features that define permissions.


Activation

No need for specific documentation. Developers can already use navigator.storage.persisted()


Debuggability

It appears there is work ongoing (see https://crbug.com/631464) for adding permission query/grant control via DevTools, so hopefully this appears "for free". The plumbing for the internal *DURABLE_STORAGE* permission type is already present.


Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes.


Is this feature fully tested by web-platform-tests?

No existing WPTs, but test added to storage/ in the CL.


Link to entry on the feature dashboard

https://www.chromestatus.com/feature/4770049554382848


Requesting approval to ship?

Yes.

Rick Byers

unread,
Aug 29, 2018, 3:11:13 PM8/29/18
to Joshua Bell, blink-dev
LGTM1 - although technically a new API, this seems non-controversial  and almost trivial.

Link to entry on the feature dashboard

https://www.chromestatus.com/feature/4770049554382848


Requesting approval to ship?

Yes.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAD649j6uSWq6MpFr2B3FBUG8YwyQOL%3D-dwnrgUL73%3DxYnyZckw%40mail.gmail.com.

Yoav Weiss

unread,
Aug 30, 2018, 3:22:06 AM8/30/18
to Rick Byers, Joshua Bell, blink-dev
LGTM2

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/CAFUtAY-Xx0UMpGA6Z-wbL8LWO08xQiFO28eff6fdV-TR-rRULg%40mail.gmail.com.

Chris Harrelson

unread,
Aug 30, 2018, 1:01:19 PM8/30/18
to Yoav Weiss, Rick Byers, Joshua Bell, blink-dev
Reply all
Reply to author
Forward
0 new messages