Coder Social home page Coder Social logo

website-helper-software's Introduction

ADPC website helper software

This repository provides a simple utility and example to help websites use Advanced Data Protection Control (ADPC).

As explained in detail specification, ADPC defines two equivalent mechanisms: one based on HTTP headers, and one based on a JavaScript interface in the browser. For many websites, the JavaScript approach may be simpler to try out, and is therefore the one demonstrated in this repository.

Usage

  1. Copy the script adpc-request-consent.js into your website and include it with a <script> tag. It will define a global function AdpcRequestConsent.
  2. Define one or more consent requests. Each such request must have the following attributes:
  • id: The request identifier (a short string to identify this request)
  • text: The textual description of the data processing, required for obtaining legally valid consent.
  • onConsent(): A callback function that is triggered if the user consents to this processing. In this function you can initiate the processing.
  • onWithdraw(): A callback function that is triggered if the user withdraws their consent for this processing. In this function you can stop the processing, delete collected data, etc.
  1. Invoke AdpcRequestConsent, passing it the consent requests as an Array.

Example

The below example requests consent for a single processing purpose:

<!-- 1. Include the helper script -->
<script src="adpc-request-consent.js"></script>

<script>
// 2. Define the request(s)
const consentRequests = [
  {
    id: "content_recommendation",
    text: "Creating an interest profile based on the pages you visit, to recommend you more interesting content.",
    onConsent: () => {
      // …enable content personalisation here…
    },
    onWithdraw: () => {
      // …disable content personalisation here…
    },
  }
];

// 3. Request consent.
AdpcRequestConsent(consentRequests)
</script>

See this example in context in src/example.html.

Testing it out

To test your website’s usage of ADPC, you could use the browser extension.

See also

website-helper-software's People

Contributors

soheil-human avatar gb-noyb avatar treora avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.