Skip to content

Commit

Permalink
Merge pull request #27 from freestarcapital/zidupdate
Browse files Browse the repository at this point in the history
WIP
  • Loading branch information
aecook authored Jul 3, 2018
2 parents 96f8949 + 8dbd9cd commit d15086c
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions modules/zeroIdBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ var samplingVal = Math.floor(Math.random() * 1000) + 1;
var labVal = Math.floor(Math.random() * 100) + 1;




var createCookie = function(name, value, days) {
var date, expires;
if (days) {
Expand Down Expand Up @@ -124,10 +122,10 @@ var domainIsOnLabList = function(){

var isOnLLCookie = getCookie("__lb");

if(isOnLLCookie && isOnLLCookie == "1"){
if(typeof isOnLLCookie != "undefined" && isOnLLCookie == "1"){
domainIsOnLabListVar = true;
}
else{
else if(typeof isOnLLCookie == "undefined"){


var jaxReq = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
Expand Down Expand Up @@ -166,16 +164,16 @@ var domainIsOnLabList = function(){
domainIsOnLabList = true;
}



if(domainIsOnLabList){
createCookie("__lb", 1 , 1);
}
else{
createCookie("__lb", 0 , 1);
}



//domainIsOnLabListVar = domainIsOnLabList;
domainIsOnLabListVar = domainIsOnLabList;

//return domainIsOnLabList;

Expand All @@ -189,19 +187,21 @@ var domainIsOnLabList = function(){
}


}();
};


var domainIsOnWhitelist = function(){
var domainIsOnWhiteList = false;
var whtList;

var isOnWLCookie = getCookie("__lb");
var isOnWLCookie = getCookie("__wl");

if(isOnWLCookie && isOnWLCookie == "1"){
domainIsOnLabListVar = true;

if(typeof isOnWLCookie != "undefined" && isOnWLCookie == "1"){
domainIsOnWhiteListVar = true;
}
else {
else if(typeof isOnWLCookie == "undefined"){



var jaxReq = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
Expand Down Expand Up @@ -241,15 +241,17 @@ var domainIsOnWhitelist = function(){
domainIsOnWhiteList = true;
}


if (domainIsOnWhiteList) {
createCookie("__wl", 1, 1);
}
else {
createCookie("__wl", 0, 1);
domainIsOnLabList();
}


//domainIsOnWhiteListVar = domainIsOnWhiteList
domainIsOnWhiteListVar = domainIsOnWhiteList

//return domainIsOnWhiteList;

Expand All @@ -263,7 +265,9 @@ var domainIsOnWhitelist = function(){



}();
};

domainIsOnWhitelist();

/**
* Read a cookie from the first party domain
Expand Down Expand Up @@ -558,7 +562,6 @@ const buildRequests = function (validBidRequests, bidderRequest) {
}
});


if(swid != "" && domainIsOnWhiteListVar){
return {
method: 'POST',
Expand Down

0 comments on commit d15086c

Please sign in to comment.