<commit_before>var webCol = "default";
try {
    webCol = document.querySelector("meta[name='theme-color']").getAttribute("content").toString();
} catch(a) {
    try {
        webCol = document.querySelector("meta[name='apple-mobile-web-app-status-bar-style']").getAttribute("content").toString();
    } catch(b) {
        try {
            webCol = document.querySelector("meta[name='msapplication-navbutton-color']").getAttribute("content").toString();
        } catch(c) {
            try {
                webCol = document.querySelector("meta[name='web-color']").getAttribute("content").toString();
            } catch(d) {
                try {
                    webCol = document.querySelector("meta[name='msapplication-TileColor']").getAttribute("content").toString();
                } catch(e) {
                    webCol = "default";
                }
            }
        }
    }
}

try {
    if(webCol === "default") {
        var cu = document.location.host;

        if     (cu.indexOf("facebook")  !== -1) webCol = "#3b5998";
        else if(cu.indexOf("google")    !== -1) webCol = "#484848";
        else if(cu.indexOf("twitter")   !== -1) webCol = "#55acee";
        else if(cu.indexOf("youtube")   !== -1) webCol = "#dd0804";

        else webCol = "default";

    }
} catch(ex) {
    webCol = "default";
}

function tryElem(elem) {
    if(webCol !== "default") return webCol;
    try {
        return document.getElementById(elem).style.backgroundColor;
    } catch(ex) {
        return "default";
    }
}

try {
    if(webCol === "default") {
        webCol = tryElem("navbar");
        webCol = tryElem("titlebar");
        webCol = tryElem("navigation");
    }
    if(webCol === "") webCol = "default";
    if(webCol.toUpperCase() === "#FFFFFF") webCol = "default";
} catch(ex) {
    webCol = "default";
}

console.log("CornHandler://setWebThemeColor:" + webCol);
<commit_msg>Optimized omnibox tinting<commit_after>var webCol = "default";
try {
    webCol = document.querySelector("meta[name='theme-color']").getAttribute("content").toString();
} catch(a) {
    try {
        webCol = document.querySelector("meta[name='msapplication-TileColor']").getAttribute("content").toString();
    } catch(b) {
        try {
            webCol = document.querySelector("meta[name='web-color']").getAttribute("content").toString();
        } catch(c) {
            try {
                webCol = document.querySelector("meta[name='apple-mobile-web-app-status-bar-style']").getAttribute("content").toString();
            } catch(d) {
                try {
                    webCol = document.querySelector("meta[name='msapplication-navbutton-color']").getAttribute("content").toString();
                } catch(e) {
                    webCol = "default";
                }
            }
        }
    }
}

try {
    if(webCol === "default") {
        var cu = document.location.host;

        if     (cu.indexOf("facebook")          !== -1) webCol = "#3b5998";
        else if(cu.indexOf("google")            !== -1) webCol = "#484848";
        else if(cu.indexOf("twitter")           !== -1) webCol = "#55acee";
        else if(cu.indexOf("youtube")           !== -1) webCol = "#dd0804";
        else if(cu.indexOf("xda-developers")    !== -1) webCol = "#de7300";

        else webCol = "default";

    }
} catch(ex) {
    webCol = "default";
}

if(webCol === "") webCol = "default";


console.log("CornHandler://setWebThemeColor:" + webCol);

{'fraction_non_alphanumeric': 0.18066378066378067, 'fraction_numerical': 0.013564213564213565, 'mean_word_length': 2.326295585412668, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1367016', 'n_tokens_mistral': 1058, 'n_tokens_neox': 1045, 'n_words': 159}