<commit_before>/**
 *  Handy curl command:
 *  curl -i -X POST --header Content-Type:"application/json" -d '' http://localhost:8085/jsonrpc
 */

var debugLogsEnabled = false;
chrome.extension.sendMessage({action: 'isDebugLogsEnabled'}, function (response) {
    if (response) {
        debugLogsEnabled = response.response;
    }
});

function getSiteName(url) {
    if (url.match("magnet:")) {
        return "magnet"
    }
    var typeRegex = '(https|http)://(www\.)?([^\.]+)\.([^/]+).+';
    return url.match(typeRegex)[3];
}

function getPluginPath(url, callback) {
    for (var i = 0; i < allModules.length; i++) {
        var module = allModules[i];
        if (module.canHandleUrl(url)) {
            module.getPluginPath(url, function(path) {
                callback(module.getMediaType(), path);
            });
        }
    }
}

function queueItem(url, callback) {
    getPluginPath(url, function (contentType, pluginPath) {<commit_msg>-Fixed debug log in background page -Add more logging to help with debugging<commit_after>/**
 *  Handy curl command:
 *  curl -i -X POST --header Content-Type:"application/json" -d '' http://localhost:8085/jsonrpc
 */

var debugLogsEnabled = localStorage[storageKeys.enableDebugLogs];

function getSiteName(url) {
    if (url.match("magnet:")) {
        return "magnet"
    }
    var typeRegex = '(https|http)://(www\.)?([^\.]+)\.([^/]+).+';
    return url.match(typeRegex)[3];
}

function getPluginPath(url, callback) {
    for (var i = 0; i < allModules.length; i++) {
        var module = allModules[i];
        if (module.canHandleUrl(url)) {
            module.getPluginPath(url, function(path) {
                callback(module.getMediaType(), path);
            });
        }
    }

    if (debugLogsEnabled) {
        console.log("No module found to handle url: '" + url + "'");
    }
}

function queueItem(url, callback) {
    getPluginPath(url, function (contentType, pluginPath) {
{'fraction_non_alphanumeric': 0.16597938144329896, 'fraction_numerical': 0.006185567010309278, 'mean_word_length': 2.8588469184890655, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '760448', 'n_tokens_mistral': 629, 'n_tokens_neox': 617, 'n_words': 133}