HEX
Server: Apache/2
System: Linux host.jethost.pl 4.19.0-26-amd64 #1 SMP Debian 4.19.304-1 (2024-01-09) x86_64
User: frigodor (1049)
PHP: 7.4.33
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname,mail
Upload Files
File: /home/frigodor/public_html/wp-content/plugins/complianz-gdpr-premium/pro/tcf/ccpa/index2.html
<html>
<!-- This HTML file is to test the different uspapi.js retun values only -->
<script src="./uspapi.js"></script>

<h3>IAB Tech Lab U.S. Privacy API Reference Implementation</h3>
Case 1: Business declared CCPA doesn't apply
<br>
<p id="section1"></p>
<script>
    // function to write the storage (usprivacy)
    const EXDAYS = 30
    function setCookie(cvalue = "1---") {
        let d = new Date();
        d.setTime(d.getTime() + (EXDAYS*24*60*60*1000));
        let expires = "expires="+ d.toUTCString();
        document.cookie = "usprivacy" + "=" + cvalue + ";" + expires + ";path=/";
    }

    // set cookie to "1---" to get started...
    setCookie();

    // check for user's optout
    window.__uspapi("getUSPData", 1, function(consent, success) { 
            if (success && consent.uspString === '1---') {
                document.getElementById("section1").innerHTML = "uspstring = \"" + consent.uspString + "\" 🤔";
            } else {
                document.getElementById("section1").innerHTML = "error retrieving the uspString";
            }
    });
</script>
<br>
Case 2: User did opt out, do not share data
<br>
<p id="section2"></p>
<script>
// set the cookie to "1YYY"
    let tmpstr = "1YYY";
    setCookie(tmpstr);
    // check for user's optout
    window.__uspapi("getUSPData", 1, function(consent, success) { 
            if (success && consent.uspString === tmpstr) {
                document.getElementById("section2").innerHTML = "uspString = \"" + consent.uspString + "\" 😟";
            } else {
                document.getElementById("section2").innerHTML = "error retrieving the uspString";
            }
    });
</script>
<br>
Case 3: User didn't opt out, business as usual
<br>
<p id="section3"></p>
<script>
    // set the cookie to "1YNY"
    tmpstr = "1YNY"
    setCookie(tmpstr);
    // check for user's optout
    window.__uspapi("getUSPData", 1, function(consent, success) { 
                if (success && consent.uspString === tmpstr) {
                document.getElementById("section3").innerHTML = "uspString = \"" + consent.uspString + "\" 😊";
                } else {
                document.getElementById("section3").innerHTML = "error retrieving the uspString";
                }
    });
</script>
</html>