Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using JSON file in Javascript-Based Interaction #17

Open
ryandcole-sudo opened this issue Jul 4, 2021 · 1 comment
Open

Consider using JSON file in Javascript-Based Interaction #17

ryandcole-sudo opened this issue Jul 4, 2021 · 1 comment

Comments

@ryandcole-sudo
Copy link

In section 7, which outlines HTTP based interaction, the server stores its consent request in a JSON file. Why not use this JSON file also in Javascript based interactions?
Many websites would want to access ADPC on both client and server side. It would be inconvenient having to use 2 separate mechanism to send requests in each case.

@gb-noyb
Copy link
Collaborator

gb-noyb commented Jul 8, 2021

We indeed discussed the option of simply passing the URL of the JSON file to the JavaScript API. However, this seems quite contrary to existing APIs, limits the flexibility of JS (e.g. asking consent while offline?), and there seems no need for it because the website can simply fetch the JSON file itself with two extra lines of code:

const response = await fetch('/my-consent-requests-resource.json');
const jsonContent = await response.json();
const userDecisions = await window.navigator.dataProtectionControl.request(jsonContent.consentRequests)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants