(function () {
var bc = { SG: true, CN: true };
var propertyId = ‘ac220a0f-f741-4dc0-b497-4e49d73338ec’;
function addPreload(as, href) {
var link = document.createElement(‘link’);
link.rel = ‘preload’;
link.as = as;
link.href = href;
link.crossOrigin = ‘anonymous’;
document.head.appendChild(link);
}
function addScript(src, attributes) {
var script = document.createElement(‘script’);
script.async = true;
script.src = src;
script.crossOrigin = ‘anonymous’;
script.setAttribute(‘fetchpriority’, ‘high’);
Object.keys(attributes).forEach(function (name) {
script.setAttribute(name, attributes[name]);
});
document.head.appendChild(script);
}
var started = false;
function load() {
if (started) {
return;
}
started = true;
addPreload(‘fetch’, ‘https://cdn.bigcrunch.com/cmp/config/’ + propertyId + ‘.json’);
addScript(‘https://dist.bigcrunch.com/cmp/cmp.js’, {
‘data-property-id’: propertyId
});
addPreload(‘script’, ‘https://cdn.bigcrunch.com/prebid/’ + propertyId + ‘.js’);
addPreload(‘fetch’, ‘https://cdn.bigcrunch.com/config/’ + propertyId + ‘.json’);
addScript(‘https://dist.bigcrunch.com/lighthouse/main.js’, {
id: ‘bigcrunchtag’,
‘data-property-id’: propertyId
});
}
var geoKey = ‘bc.shared.geo’;
function countryCode(value) {
var country = String(value || ”).toUpperCase();
return /^[A-Z]{2}$/.test(country) && country ! ‘EU’ ? country : ”;
}
function readStored() {
try {
var exp = parseInt(localStorage.getItem(geoKey + ‘.exp’), 10);
if (exp && Date.now() > exp) {
}
var data = JSON.parse(localStorage.getItem(geoKey) || ”);
return countryCode(data && data.country);
} catch (e) {
return ”;
}
}
function remember(data) {
var country = countryCode(data && data.country);
if (!country) {
return;
}
try {
localStorage.setItem(geoKey, JSON.stringify({
country: country,
region: String((data && data.region) || ”).toUpperCase(),
consent_country_code: String((data && data.consent_country_code) ||


country).toUpperCase()
}));
localStorage.setItem(geoKey + ‘.exp’, String(Date.now() + 1800000));
} catch (e) {}
}
var stored = readStored();
if (stored && !bc[stored]) {
load();
}
var decided = false;
function finish(data) {
if (decided) {
return;
}
decided = true;
var c = countryCode(data && data.country);
if (c && stored && stored ! c) {
new Image().src = ‘https://www.hoopsrumors.com/wp-includes/images/blank.gif?c=’ + stored + ‘-‘ + c;
}
if (c) {
remember(data);
}
if (!c && stored && bc[stored]) {
return;
}
if (!bc[c]) {
load();
}
}
var xhr = new XMLHttpRequest();
xhr.open(‘GET’, ‘https://geo.bigcrunch.com/’, true);
xhr.onreadystatechange = function () {
if (xhr.readyState ! 4) {
return;
}
var data = null;
if (xhr.status >= 200 && xhr.status < 300) {
try {
data = JSON.parse(xhr.responseText);
} catch (e) {}
}
finish(data);
};
xhr.onerror = function () {
finish(”);
};
xhr.send();
})();
Bu gelişme hakkında düşüncelerinizi, donanım deneyimlerinizi veya sorularınızı Topluluk Forumumuzda paylaşın.
Foruma Katıl & Yanıtla ➔