PageSourceSearch

https://itb.edu.ec/?debugbar

js itb.edu.ec collected 2026-09-24 10:27:15 UTC 3,909 bytes, 90 lines download raw bytes

1document.addEventListener('DOMContentLoaded', loadDoc, false);
2
3function loadDoc(time) {
4    if (isNaN(time)) {
5        time = document.getElementById("debugbar_loader").getAttribute("data-time");
6        localStorage.setItem('debugbar-time', time);
7    }
8
9    localStorage.setItem('debugbar-time-new', time);
10
11    let url = 'https://itb.edu.ec';
12    let xhttp = new XMLHttpRequest();
13
14    xhttp.onreadystatechange = function() {
15        if (this.readyState === 4 && this.status === 200) {
16            let toolbar = document.getElementById("toolbarContainer");
17
18            if (! toolbar) {
19                toolbar = document.createElement('div');
20                toolbar.setAttribute('id', 'toolbarContainer');
21                document.body.appendChild(toolbar);
22            }
23
24            let responseText = this.responseText;
25            let dynamicStyle = document.getElementById('debugbar_dynamic_style');
26            let dynamicScript = document.getElementById('debugbar_dynamic_script');
27
28            // get the first style block, copy contents to dynamic_style, then remove here
29            let start = responseText.indexOf('>', responseText.indexOf('<style')) + 1;
30            let end = responseText.indexOf('</style>', start);
31            dynamicStyle.innerHTML = responseText.substr(start, end - start);
32            responseText = responseText.substr(end + 8);
33
34            // get the first script after the first style, copy contents to dynamic_script, then remove here
35            start = responseText.indexOf('>', responseText.indexOf('<script')) + 1;
36            end = responseText.indexOf('\<\/script>', start);
37            dynamicScript.innerHTML = responseText.substr(start, end - start);
38            responseText = responseText.substr(end + 9);
39
40            // check for last style block, append contents to dynamic_style, then remove here
41            start = responseText.indexOf('>', responseText.indexOf('<style')) + 1;
42            end = responseText.indexOf('</style>', start);
43            dynamicStyle.innerHTML += responseText.substr(start, end - start);
44            responseText = responseText.substr(0, start - 8);
45
46            toolbar.innerHTML = responseText;
47
48            if (typeof ciDebugBar === 'object') {
49                ciDebugBar.init();
50            }
51        } else if (this.readyState === 4 && this.status === 404) {
52            console.log('CodeIgniter DebugBar: File "WRITEPATH/debugbar/debugbar_' + time + '" not found.');
53        }
54    };
55
56    xhttp.open("GET", url + "?debugbar_time=" + time, true);
57    xhttp.send();
58}
59
60window.oldXHR = window.ActiveXObject
61    ? new ActiveXObject('Microsoft.XMLHTTP')
62    : window.XMLHttpRequest;
63
64function newXHR() {
65    const realXHR = new window.oldXHR();
66
67    realXHR.addEventListener("readystatechange", function() {
68        // Only success responses and URLs that do not contains "debugbar_time" are tracked
69        if (realXHR.readyState === 4 && realXHR.status.toString()[0] === '2' && realXHR.responseURL.indexOf('debugbar_time') === -1) {
70            if (realXHR.getAllResponseHeaders().indexOf("Debugbar-Time") >= 0) {
71                let debugbarTime = realXHR.getResponseHeader('Debugbar-Time');
72
73                if (debugbarTime) {
74                    let h2 = document.querySelector('#ci-history > h2');
75
76                    if (h2) {
77                        h2.innerHTML = 'History <small>You have new debug data.</small> <button id="ci-history-update">Update</button>';
78                        document.querySelector('a[data-tab="ci-history"] > span > .badge').className += ' active';
79                        document.getElementById('ci-history-update').addEventListener('click', function () {
80                            loadDoc(debugbarTime);
81                        }, false)
82                    }
83                }
84            }
85        }
86    }, false);
87    return realXHR;
88}
89
90window.XMLHttpRequest = newXHR;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.