function loadDoc(time) {
if (isNaN(time)) {
time = document.getElementById("debugbar_loader").getAttribute("data-time");
localStorage.setItem('debugbar-time', time);
}
localStorage.setItem('debugbar-time-new', time);
var url = "https://www.alimranmuslimaid.org";
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState === 4 && this.status === 200) {
var toolbar = document.getElementById("toolbarContainer");
if (!toolbar) {
toolbar = document.createElement('div');
toolbar.setAttribute('id', 'toolbarContainer');
document.body.appendChild(toolbar);
}
// copy for easier manipulation
let responseText = this.responseText;
// get csp blocked parts
// the style block is the first and starts at 0
{
let PosBeg = responseText.indexOf( '>', responseText.indexOf( '', PosBeg );
document.getElementById( 'debugbar_dynamic_style' ).innerHTML += responseText.substr( PosBeg, PosEnd - PosBeg );
responseText = responseText.substr( 0, PosBeg + 8 );
}
toolbar.innerHTML = responseText;
if (typeof ciDebugBar === 'object') {
ciDebugBar.init();
}
} else if (this.readyState === 4 && this.status === 404) {
console.log('CodeIgniter DebugBar: File "WRITEPATH/debugbar/debugbar_' + time + '" not found.');
}
};
xhttp.open("GET", url + "?debugbar_time=" + time, true);
xhttp.send();
}
if (window.ActiveXObject) {
var oldXHR = new ActiveXObject('Microsoft.XMLHTTP');
} else {
var oldXHR = window.XMLHttpRequest;
}
function newXHR() {
var realXHR = new oldXHR();
realXHR.addEventListener("readystatechange", function() {
if (realXHR.readyState === 4 && realXHR.status.toString()[0] === '2' && realXHR.responseURL.indexOf('debugbar_time') === -1) {
if (realXHR.getAllResponseHeaders().indexOf("Debugbar-Time") >= 0) {
var debugbarTime = realXHR.getResponseHeader('Debugbar-Time');
if (debugbarTime) {
var h2 = document.querySelector('#ci-history > h2');
if (h2) {
h2.innerHTML = 'History You have new debug data. ';
var badge = document.querySelector('a[data-tab="ci-history"] > span > .badge');
badge.className += ' active';
}
}
}
}
}, false);
return realXHR;
}
window.XMLHttpRequest = newXHR;