ondecisionchange called to early
Opened this issue · 0 comments
janwinkler commented
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:
-
setup event listener
navigator.dataProtectionControl.addEventListener('decisionchange', function (event)
{
myfunction(event.userDecisions);
}); -
call for consent
navigator.dataProtectionControl.request(purposes).then(function (r) { doSomething(r); }); -
consent window appears. now change one of the purpose toggles but do not click on confirm. the event listener will be called already