<commit_before>chrome.extension.sendMessage({}, function(response) {
	var readyStateCheckInterval = setInterval(function() {
	if (document.readyState === "complete") {
		clearInterval(readyStateCheckInterval);

		// ----------------------------------------------------------
		// This part of the script triggers when page is done loading
		// ----------------------------------------------------------


        /**
         * This function runs the function parameter within the context of the actual page,
         * since chrome extensions have limited access to page objects and methods.
         * This only works for functions that are self-contained - ie, closures don't persist
         * when you stringify functions like this, so don't rely on anything outside of the
         * function itself.
         */
        var runAsPage = function(fun) {
            // only run functions
            if (!typeof fun === 'function') return false;

            // make a new script element
            var script = document.createElement('script');

            // stringify function and invoke in string
            var scriptContent = '(' + fun.toString() + ')();';

            // add script content to the script, and add the script to the body, "running it"
            script.appendChild(document.createTextNode(scriptContent));
            document.body.appendChild(script);

            // success
            return true;
        };

        /**
         * This function makes the standalonification happen!
         */
        var standalonify = function(){

            // run code as if it's on the native page, since chrome extensions
            // have limited access to page objects and methods
            runAsPage(function(){
                var timeStr, totalSeconds;//, seconds, minutes, totalMinutes, hours, totalHours;
                var location = window.location;
                var urlBits, videoIdParameter, videoId, newUrl;

                // padNum adds leading zeros. It's in here so it's accessible in the page's memory space
                var padNum = function(num, digits) {
                    var numStr = num.toString();
                    while (numStr.length < digits) {
                        numStr = '0' + numStr;
                    }
                    return numStr;
                };

                // get the current time of the video (only works when run in the page's memory space)
                totalSeconds = document.getElementById('movie_player').getCurrentTime();

                // round to the nearest second
                totalSeconds = Math.floor(totalSeconds);

                // convert the time into youtube's format (eg. 132 is 1m 32s)
                // seconds = totalSeconds % 60;
                // totalMinutes = ((totalSeconds - seconds) / 60);
                // minutes = totalMinutes % 60;
                // totalHours = ((totalMinutes - minutes) / 60);
                // hours = totalHours % 60;

                // timeStr = padNum(hours, 2) + padNum(minutes, 2) + padNum(seconds, 2);
                // console.log(timeStr);
                timeStr = String(totalSeconds);

                // reform the url
                urlBits = location.search.slice(1).split('&');<commit_msg>commented out padNum, no longer needed<commit_after>chrome.extension.sendMessage({}, function(response) {
	var readyStateCheckInterval = setInterval(function() {
	if (document.readyState === "complete") {
		clearInterval(readyStateCheckInterval);

		// ----------------------------------------------------------
		// This part of the script triggers when page is done loading
		// ----------------------------------------------------------


        /**
         * This function runs the function parameter within the context of the actual page,
         * since chrome extensions have limited access to page objects and methods.
         * This only works for functions that are self-contained - ie, closures don't persist
         * when you stringify functions like this, so don't rely on anything outside of the
         * function itself.
         */
        var runAsPage = function(fun) {
            // only run functions
            if (!typeof fun === 'function') return false;

            // make a new script element
            var script = document.createElement('script');

            // stringify function and invoke in string
            var scriptContent = '(' + fun.toString() + ')();';

            // add script content to the script, and add the script to the body, "running it"
            script.appendChild(document.createTextNode(scriptContent));
            document.body.appendChild(script);

            // success
            return true;
        };

        /**
         * This function makes the standalonification happen!
         */
        var standalonify = function(){

            // run code as if it's on the native page, since chrome extensions
            // have limited access to page objects and methods
            runAsPage(function(){
                var timeStr, totalSeconds;//, seconds, minutes, totalMinutes, hours, totalHours;
                var location = window.location;
                var urlBits, videoIdParameter, videoId, newUrl;

                // padNum adds leading zeros. It's in here so it's accessible in the page's memory space
                // var padNum = function(num, digits) {
                //     var numStr = num.toString();
                //     while (numStr.length < digits) {
                //         numStr = '0' + numStr;
                //     }
                //     return numStr;
                // };

                // get the current time of the video (only works when run in the page's memory space)
                totalSeconds = document.getElementById('movie_player').getCurrentTime();

                // round to the nearest second
                totalSeconds = Math.floor(totalSeconds);

                // convert the time into youtube's format (eg. 132 is 1m 32s)
                // seconds = totalSeconds % 60;
                // totalMinutes = ((totalSeconds - seconds) / 60);
                // minutes = totalMinutes % 60;
                // totalHours = ((totalMinutes - minutes) / 60);
                // hours = totalHours % 60;

                // timeStr = padNum(hours, 2) + padNum(minutes, 2) + padNum(seconds, 2);
                // console.log(timeStr);
                timeStr = String(totalSeconds);

                // reform the url
                urlBits = location.search.slice(1).split('&');
{'fraction_non_alphanumeric': 0.125, 'fraction_numerical': 0.006363636363636364, 'mean_word_length': 1.54373795761079, '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': '4909615', 'n_tokens_mistral': 1617, 'n_tokens_neox': 1446, 'n_words': 534}