-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathload-cookie.html
More file actions
executable file
·16 lines (16 loc) · 5.48 KB
/
load-cookie.html
File metadata and controls
executable file
·16 lines (16 loc) · 5.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script type="text/javascript">
// cookie-sync start
!function(n){var r={};function o(t){if(r[t])return r[t].exports;var e=r[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,o),e.l=!0,e.exports}o.m=n,o.c=r,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=0)}([function(t,e,n){"use strict";var o=function(t){if(t&&t.__esModule)return t;var e=c();if(e&&e.has(t))return e.get(t);var n={};if(null!=t){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var i=r?Object.getOwnPropertyDescriptor(t,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=t[o]}}n.default=t,e&&e.set(t,n);return n}(n(1));function c(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return c=function(){return t},t}function u(){return(u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r,i,a=(b("endpoint",window.location.search),"https://prebid.bydata.com/cookie_sync"),s=function(t){if(t){var e=t.split(",").reduce(function(t,e){var n=e.split(":");return 2===n.length&&""!==n[0]&&""!==n[1]&&(t[n[0]]=/^\d+$/.test(n[1])?parseInt(n[1]):n[1]),t},{});return e&&Object.keys(e).length?e:void 0}}(b("args",window.location.search)),l=b("max_sync_count",window.location.search),d=function(t){if(isNaN(t)||t<0)return 9007199254740991;return t}(parseInt(l||10,10)),p=function(t){if(0===t||1===t)return t;console.log("Ignoring gdpr param, it should be 1 or 0")}(parseInt(b("gdpr",window.location.search),10)),g=function(t){if(t)return t;console.log("Ignoring gdpr_consent param, it should be a non empty value")}(b("gdpr_consent",window.location.search)),y=new RegExp(/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i);function m(t,e,n,r){e&&y.test(e)?"image"===t||"redirect"===t?(console.log('Invoking image pixel user sync for bidder: "'.concat(n,'"')),function(t,e){var n=new Image;n.addEventListener("load",e),n.addEventListener("error",e),n.src=t}(e,r)):"iframe"==t?(console.log('Invoking iframe pixel user sync for bidder: "'.concat(n,'"')),function(t,e,n){if(!t)return;var r=o.getEmptyIframe(0,0);r.id="sync_".concat(e,"_").concat(Date.now()),r.src=t,r.onload=n,o.insertElement(r,document,"html")}(e,n,r)):(console.log('User sync type "'.concat(t,'" not supported for bidder: "').concat(n,'"')),r()):(console.log('No valid sync url for bidder "'.concat(n,'": ').concat(e)),r())}function b(t,e){var n=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))}!function(t,e,n,r){var o=3<arguments.length&&void 0!==r?r:{};try{var i,c=o.method||(n?"POST":"GET"),a="object"===f(e)?e:{success:function(){console.log("xhr success")},error:function(t){console.log("xhr error",null,t)}};if("function"==typeof e&&(a.success=e),(i=new window.XMLHttpRequest).onreadystatechange=function(){if(4===i.readyState){var t=i.status;200<=t&&t<300||304===t?a.success(i.responseText,i):a.error(i.statusText,i)}},i.ontimeout=function(){console.log("xhr timeout after ",i.timeout,"ms")},"GET"===c&&n){var s=parseURL(t,o);u(s.search,n),t=formatURL(s)}i.open(c,t),i.timeout=3e3,o.withCredentials&&(i.withCredentials=!0),o.preflight&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.setRequestHeader("Content-Type",o.contentType||"text/plain"),"POST"===c&&n?i.send(n):i.send()}catch(t){console.log("xhr construction",t)}}(a,function(t){var e=JSON.parse(t);"ok"!==e.status&&"no_cookie"!==e.status||e.bidder_status&&!function t(e){if(0!==e.length){var n=e.pop();n.no_cookie?m(n.usersync.type,n.usersync.url,n.bidder,t.bind(null,e)):t(e)}}(e.bidder_status)},((i=(r=s)&&"object"===f(r)?r:{}).limit=d,p&&(i.gdpr=p),g&&(i.gdpr_consent=g),JSON.stringify(i)),{withCredentials:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getEmptyIframe=function(t,e){var n=document.createElement("iframe");return n.setAttribute("frameborder",0),n.setAttribute("scrolling","no"),n.setAttribute("marginheight",0),n.setAttribute("marginwidth",0),n.setAttribute("TOPMARGIN",0),n.setAttribute("LEFTMARGIN",0),n.setAttribute("allowtransparency","true"),n.setAttribute("width",e),n.setAttribute("height",t),n},e.insertElement=function(t,e,n){var r;e=e||document,r=n?e.getElementsByTagName(n):e.getElementsByTagName("head");try{(r=r.length?r:e.getElementsByTagName("body")).length&&(r=r[0]).insertBefore(t,r.firstChild)}catch(t){}}}]);
// end.
</script>
</head>
<body>
</body>
</html>