Open Leedehai opened 1 year ago
@lamrowena move the proposal to GPP?
I have a question : No matter if the consent is different between Tab 1 and Tab 2 from this visitor, the negative consent is not supposed to be superior to a positive consent? Which means that the vendors behind will have to monitor
Indeed, the CMP vendor needs to listen to states broadcast from CMPs running in other browser contexts (e.g. tabs), as mentioned
The CMP instance shall add a listener on the channel object so as to receive notifications from peer CMP instances from other browsing contexts.
channel.onmessage = (event) => { useMessageData(event.data); };
This issue proposes a way to deal with CMP inconsistencies across browsing contexts (e.g. tabs or iframes) from the same origin.
Problem
Currently, the spec cannot guarantee the consent states’ consistency across multiple browsing contexts in the same client. For example, a user might be perplexed by this situation:
The cause of this situation is that the CMPs running in multiple tabs’ JS contexts don’t have a way to synchronize their states.
Idea
The spec shall add in the CMP implementation guideline doc that
Suggested implementation: to achieve this consistency, a CMP shall create and maintain a BroadcastChannel object.
The name of this object shall be unique among different CMP vendors, so that the CMPs from different vendors don’t cross-talk with each other, e.g.
This naming scheme is not intended to prevent tampering or eavesdropping. That is, an attacker could create a broadcast channel using the same name and then send or receive messages on this channel.
The Broadcast Channel API guarantees that broadcast channels of the same name but in contexts of different origins are isolated from each other; therefore, it is not necessary to include the publisher origin in the broadcast channel name.
Whenever a consent state changes internally, it shall post a message to this channel object, notifying peer CMP instances in other browsing contexts.
Though the message data type is up to CMP implementations, the type must be serializable using the structured clone algorithm.
The CMP instance shall add a listener on the channel object so as to receive notifications from peer CMP instances from other browsing contexts.
BroadcastChannel
is a CMP internal detail, and therefore completely transparent to the calling scripts that communicate with the CMP. In other words, the API shall remain the same and the calling scripts shall be agnostic of this synchronization feature.