Bug 217066 - Create an API for a page to ask if it should display a consent banner
Summary: Create an API for a page to ask if it should display a consent banner
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kate Cheney
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-09-28 16:16 PDT by Kate Cheney
Modified: 2020-10-01 09:01 PDT (History)
8 users (show)

See Also:


Attachments
Patch (42.79 KB, patch)
2020-09-28 16:26 PDT, Kate Cheney
no flags Details | Formatted Diff | Diff
Patch (45.87 KB, patch)
2020-09-30 11:55 PDT, Kate Cheney
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kate Cheney 2020-09-28 16:16:20 PDT
We should create API where sites can query to determine whether they should display various consent banners.
Comment 1 Radar WebKit Bug Importer 2020-09-28 16:17:39 PDT
<rdar://problem/69722542>
Comment 2 Kate Cheney 2020-09-28 16:26:54 PDT
Created attachment 409927 [details]
Patch
Comment 3 Sam Weinig 2020-09-28 16:33:33 PDT
Is this based on a spec?
Comment 4 Kate Cheney 2020-09-30 11:55:30 PDT
Created attachment 410143 [details]
Patch
Comment 5 Kate Cheney 2020-09-30 11:56:07 PDT
(In reply to Sam Weinig from comment #3)
> Is this based on a spec?

No. It is now behind an experimental feature flag which is off by default.
Comment 6 Sam Weinig 2020-09-30 13:42:27 PDT
This is quite hard to review without either a spec to follow or some explanation of what the intended behavior is. Can you write up a more detailed explanation about what this is all about?

What even is a "consent banner"?
Comment 7 Dean Jackson 2020-09-30 19:26:56 PDT
What is the consent for? The API is just "shouldShowConsentBanner()" on Document, but no details on what that means.

Also, how does a Document show a consent banner? This is the API for asking if it should. I would have expected the feature to develop the other way around - with the actual consent banner landing first.

I think this patch needs a description of what the feature is, and why it is different from the standard permissions API (https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API). Even if it isn't something that can fit in there, it would be worth making this new thing follow the same design as Permissions (you don't ask if you can ask - you would ask if you have consent). In fact, Permissions has a possible value of "prompt", which sounds a lot like what you're asking.

One snag is the permissions API is on navigator, whereas this patch is adding to Document.