-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
97 lines (82 loc) · 4.83 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>WebView</title>
<link href="styles/main.css" rel="stylesheet" type="text/css">
<script type="text/javascript">window.gdprAppliesGlobally=true;(function(){function n(e){if(!window.frames[e]){if(document.body&&document.body.firstChild){var t=document.body;var r=document.createElement("iframe");r.style.display="none";r.name=e;r.title=e;t.insertBefore(r,t.firstChild)}else{setTimeout(function(){n(e)},5)}}}function e(r,a,o,c,s){function e(e,t,r,n){if(typeof r!=="function"){return}if(!window[a]){window[a]=[]}var i=false;if(s){i=s(e,n,r)}if(!i){window[a].push({command:e,version:t,callback:r,parameter:n})}}e.stub=true;e.stubVersion=2;function t(n){if(!window[r]||window[r].stub!==true){return}if(!n.data){return}var i=typeof n.data==="string";var e;try{e=i?JSON.parse(n.data):n.data}catch(t){return}if(e[o]){var a=e[o];window[r](a.command,a.version,function(e,t){var r={};r[c]={returnValue:e,success:t,callId:a.callId};n.source.postMessage(i?JSON.stringify(r):r,"*")},a.parameter)}}if(typeof window[r]!=="function"){window[r]=e;if(window.addEventListener){window.addEventListener("message",t,false)}else{window.attachEvent("onmessage",t)}}}e("__tcfapi","__tcfapiBuffer","__tcfapiCall","__tcfapiReturn");n("__tcfapiLocator");(function(e,t){var r=document.createElement("link");r.rel="preconnect";r.as="script";var n=document.createElement("link");n.rel="dns-prefetch";n.as="script";var i=document.createElement("link");i.rel="preload";i.as="script";var a=document.createElement("script");a.id="spcloader";a.type="text/javascript";a["async"]=true;a.charset="utf-8";var o="https://sdk.privacy-center.org/"+e+"/loader.js?target_type=notice&target="+t;if(window.didomiConfig&&window.didomiConfig.user){var c=window.didomiConfig.user;var s=c.country;var d=c.region;if(s){o=o+"&country="+s;if(d){o=o+"®ion="+d}}}r.href="https://sdk.privacy-center.org/";n.href="https://sdk.privacy-center.org/";i.href=o;a.src=o;var f=document.getElementsByTagName("script")[0];f.parentNode.insertBefore(r,f);f.parentNode.insertBefore(n,f);f.parentNode.insertBefore(i,f);f.parentNode.insertBefore(a,f)})("7dd8ec4e-746c-455e-a610-99121b4148df","ABMjPKBE")})();</script>
<script type="text/javascript">
function updateTable() {
// Get table element
var table = document.getElementsByTagName("table")[0];
// Clear existing rows except header row
while (table.childElementCount > 1) {
table.removeChild(table.lastChild);
}
// Get vendors
var vendors = Didomi.getRequiredVendors();
// Loop through all vendors
vendors.forEach(vendor => {
// Get the name and the consent status of the vendor
var name = vendor.name;
var id = vendor.id;
var status;
switch (Didomi.getUserConsentStatusForVendor(id)) {
case true:
status = "Enabled";
break;
case false:
status = "Disabled";
break;
case undefined:
status = "Undefined";
break;
};
// Create a new row containing the name and consent status of the vendor
var row = document.createElement("tr");
var nameData = document.createElement("td");
var statusData = document.createElement("td");
var nameNode = document.createTextNode(name);
var statusNode = document.createTextNode(status);
nameData.appendChild(nameNode);
statusData.appendChild(statusNode);
row.appendChild(nameData);
row.appendChild(statusData);
// Add the new row to the table
table.appendChild(row);
});
}
</script>
<script type="text/javascript">
window.didomiOnReady = window.didomiOnReady || [];
window.didomiOnReady.push(function (Didomi) {
// Update the table when the SDK is ready
updateTable();
});
window.didomiEventListeners = window.didomiEventListeners || [];
window.didomiEventListeners.push({
event: 'consent.changed',
listener: function (context) {
// Update the table when the consent status has changed
updateTable();
}
});
</script>
</head>
<body>
<div id="container">
<div>
<h1>This is a WebView</h1>
<p>The consent status is shared with the WebView:</p>
<table>
<tr>
<th>Vendor</th>
<th>Status*</th>
</tr>
</table>
<div class="footnote">* Taking into account the list of purposes declared for the vendor.</div>
</div>
</div>
</body>
</html>