/** * This function search for third party scripts. * This third party scripts can generate third party cookies. * * It returns a list of possible domains of third parties for the cookies.js in the pop up window */ function findThirdpartydomains(){ try{ var result = []; //this gets the url of the third party script $("script").each(function(){ let url = $(this).attr("src"); if(typeof url !== "undefined"){ if(url.startsWith("/")){ if(url.startsWith("//")){ result.push(url); } } else { result.push(url); } } }); // For youtube $("iframe").each(function(){ let url = $(this).attr("src"); if(typeof url !== "undefined"){ if(url.startsWith("/")){ if(url.startsWith("//")){ result.push(url); } } else { result.push(url); } } }); console.log("--------"); console.log(result); console.log("--------"); return result; } catch(e){ console.log(e); } }