forked from InteractiveAdvertisingBureau/CCPA-reference-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiframe.html
More file actions
26 lines (25 loc) · 863 Bytes
/
iframe.html
File metadata and controls
26 lines (25 loc) · 863 Bytes
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
<html>
<meta charset="UTF-8">
<script>
window.addEventListener('message', (event) => {
const data = event && event.data && event.data.__uspapiReturn;
if (data)
if (data.success && data.returnValue.uspString) {
document.getElementById("result").innerHTML = "uspstring = \"" + data.returnValue.uspString + "\" 🤔";
} else {
document.getElementById("result").innerHTML = "error retrieving the uspString";
}
}, false);
window.top.postMessage({
__uspapiCall: {
callId: Math.random(),
command: 'getUSPData',
version: 1
}
}, '*');
</script>
<body style="background-color: #e3f2fd">
<b>iframe content</b>
<p id="result"></p>
</body>
</html>