<commit_before>//var debugMode = true;
if (!window["debugMode"]) {
    window["debugMode"] = false;
}
var hasInjected = false;
var sessionKey = "WebGLInspectorEnabled" + (debugMode ? "Debug" : "");

function getExtensionURL() {
    if (window["chrome"]) {
        return chrome.extension.getURL("");
    } else if (window["safari"]) {
        return safari.extension.baseURI;
    }
};

function notifyPresent() {
    if (window["chrome"]) {
        chrome.extension.sendRequest({ present: true }, function (response) { });
    } else if (window["safari"]) {
        safari.self.tab.dispatchMessage("notifyPresent", { present: true });
    }
};

function notifyEnabled(present) {
    if (window["chrome"]) {
        chrome.extension.sendRequest({ present: present }, function (response) { });
    } else if (window["safari"]) {
        safari.self.tab.dispatchMessage("message", { present: present });
    }
};

function listenForMessage(callback) {
    if (window["chrome"]) {
        chrome.extension.onRequest.addListener(callback);
    } else if (window["safari"]) {
        safari.self.addEventListener("message", callback);
    }
};

function insertHeaderNode(node) {
    var targets = [document.body, document.head, document.documentElement];
    for (var n = 0; n < targets.length; n++) {
        var target = targets[n];
        if (target) {
            if (target.firstElementChild) {
                target.insertBefore(node, target.firstElementChild);
            } else {
                target.appendChild(node);
            }
            break;
        }
    }
};

function insertStylesheet(url) {
    var link = document.createElement("link");
    link.rel = "stylesheet";
    link.href = cssurl;
    insertHeaderNode(link);
};

function insertScript(url) {
    var script = document.createElement("script");
    script.type = "text/javascript";
    script.src = jsurl;
    insertHeaderNode(script);
};


// If we're reloading after enabling the inspector, load immediately
if (sessionStorage[sessionKey] == "yes") {
    hasInjected = true;

    var pathRoot = getExtensionURL();

    if (debugMode) {
        // We have the loader.js file ready to help out
        gliloader.pathRoot = pathRoot;
        gliloader.load(["loader", "host", "replay", "ui"], function () {
            // ?
        });
    } else {
        var jsurl = pathRoot + "gli.all.js";
        var cssurl = pathRoot + "gli.all.css";

        insertStylesheet(cssurl);
        insertScript(jsurl);
    }

    notifyPresent();
}

// Once the DOM is ready, bind to the content event
document.addEventListener("DOMContentLoaded", function () {<commit_msg>fix bad copy paste bug<commit_after>//var debugMode = true;
if (!window["debugMode"]) {
    window["debugMode"] = false;
}
var hasInjected = false;
var sessionKey = "WebGLInspectorEnabled" + (debugMode ? "Debug" : "");

function getExtensionURL() {
    if (window["chrome"]) {
        return chrome.extension.getURL("");
    } else if (window["safari"]) {
        return safari.extension.baseURI;
    }
};

function notifyPresent() {
    if (window["chrome"]) {
        chrome.extension.sendRequest({ present: true }, function (response) { });
    } else if (window["safari"]) {
        safari.self.tab.dispatchMessage("notifyPresent", { present: true });
    }
};

function notifyEnabled(present) {
    if (window["chrome"]) {
        chrome.extension.sendRequest({ present: present }, function (response) { });
    } else if (window["safari"]) {
        safari.self.tab.dispatchMessage("message", { present: present });
    }
};

function listenForMessage(callback) {
    if (window["chrome"]) {
        chrome.extension.onRequest.addListener(callback);
    } else if (window["safari"]) {
        safari.self.addEventListener("message", callback);
    }
};

function insertHeaderNode(node) {
    var targets = [document.body, document.head, document.documentElement];
    for (var n = 0; n < targets.length; n++) {
        var target = targets[n];
        if (target) {
            if (target.firstElementChild) {
                target.insertBefore(node, target.firstElementChild);
            } else {
                target.appendChild(node);
            }
            break;
        }
    }
};

function insertStylesheet(url) {
    var link = document.createElement("link");
    link.rel = "stylesheet";
    link.href = url;
    insertHeaderNode(link);
    return link;
};

function insertScript(url) {
    var script = document.createElement("script");
    script.type = "text/javascript";
    script.src = url;
    insertHeaderNode(script);
    return script;
};


// If we're reloading after enabling the inspector, load immediately
if (sessionStorage[sessionKey] == "yes") {
    hasInjected = true;

    var pathRoot = getExtensionURL();

    if (debugMode) {
        // We have the loader.js file ready to help out
        gliloader.pathRoot = pathRoot;
        gliloader.load(["loader", "host", "replay", "ui"], function () {
            // ?
        });
    } else {
        var jsurl = pathRoot + "gli.all.js";
        var cssurl = pathRoot + "gli.all.css";

        insertStylesheet(cssurl);
        insertScript(jsurl);
    }

    notifyPresent();
}

// Once the DOM is ready, bind to the content event
document.addEventListener("DOMContentLoaded", function () {
{'fraction_non_alphanumeric': 0.14484574868322048, 'fraction_numerical': 0.0003762227238525207, 'mean_word_length': 2.795146324054247, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5817088', 'n_tokens_mistral': 1551, 'n_tokens_neox': 1536, 'n_words': 350}