GoogleChromeLabs / protected-audience-demo

Apache License 2.0
15 stars 10 forks source link

Feature join-ad-interest-group is not enabled by Permissions Policy #15

Closed alexm92 closed 1 year ago

alexm92 commented 1 year ago

Started to see this error message on the advertiser. Uncaught (in promise) DOMException: Failed to execute 'joinAdInterestGroup' on 'Navigator': Feature join-ad-interest-group is not enabled by Permissions Policy

A similar message is on the publisher, but for run-ad-auction

image
dmdabbs commented 1 year ago

@alexm92 on all Chrome versions (Canary, Dev, Beta, Stable) I see these warnings, not an exception:

image

I tried to use Chrome's "header overrides" feature to add the Permissions-Policy header to the advertiser page response to grant the DSP permission and eliminate that warning, but it didn't work. I guess PAAPI doesn't see the overridden, additional header:

image

Google folks, consider adding the Permissions-Policy header for one of the embedded sites' iframes as an example, perhaps also with pointer to https://developer.chrome.com/en/docs/privacy-sandbox/permissions-policy/.

dmdabbs commented 1 year ago

DOH, one also needs to add the allow attribute to the iframe.

Adding it (via response override)

<iframe allow='join-ad-interest-group' id='adtech-pixel' src='https://protected-audience-demo-adtech.web.app'>

did not eliminate the error.

alexm92 commented 1 year ago

@dmdabbs Maybe I'm in one of the experiments. For me, it's an error, not a warning.

I've cloned the demo repository and run it under a domain that I control. Everything worked well until a few days ago when the permission policy got enforced (for me).

I've tried both adding Permissions-Policy: join-ad-interest-group=(self "https://protected-audience-demo-dsp.web.app") and <iframe allow="join-ad-interest-group" src="https://protected-audience-demo-adtech.web.app"></iframe>. Neither seems to work.

Additionally, the SSP code does not run in an iframe, but directly on the publisher's page.

dmdabbs commented 1 year ago

Any suggestions @samdutton or @kevinkiklee?

alexm92 commented 1 year ago

Figured out this happened because of uBlock Origin browser extension that I had installed