Data-Protection-Control/browser-extension

ondecisionchange called to early

Opened this issue · 0 comments

the event listener for decisionchange is already called when the user changes the toggle status for a purpose and not only when the user clicks on confirm choices. this could lead to the result that tracking is already activated, although the user did not confirm the choices yet.

how to replicate:

  1. setup event listener
    navigator.dataProtectionControl.addEventListener('decisionchange', function (event)
    {
    myfunction(event.userDecisions);
    });

  2. call for consent
    navigator.dataProtectionControl.request(purposes).then(function (r) { doSomething(r); });

  3. consent window appears. now change one of the purpose toggles but do not click on confirm. the event listener will be called already