{"size": 1366, "ext": "js", "max_stars_repo_path": "module/panel/findJS.js", "max_stars_repo_name": "TTTN-sang/xssdemo", "max_stars_repo_stars_event_min_datetime": "2015-06-15T13:20:53.000Z", "max_stars_repo_stars_event_max_datetime": "2015-06-15T13:20:53.000Z", "max_issues_repo_path": "module/panel/findJS.js", "max_issues_repo_name": "TTTN-sang/xssdemo", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "module/panel/findJS.js", "max_forks_repo_name": "TTTN-sang/xssdemo", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 34.15, "max_line_length": 79, "alphanum_fraction": 0.5629575403}
/**
 * Created by N on 6/2/15.
 */
//
//chrome.browserAction.onClicked.addListener(function(tab) {
//    chrome.tabs.executeScript(null,{
//        code:'document.body.style.backgroundColor="red"'
//    },function(result){
//        document.querySelector('.button').innerHTML = string(result);
//    });
//});

window.onload = function() {
    var btn = document.querySelector('.button');
    chrome.devtools.inspectedWindow.getResources(function(resources){
        for (var r in resources){
            var tbody = document.querySelector('tbody');
            var tr = document.createElement('tr');
            var td1 = document.createElement('td');
            var index=tbody.getElementsByTagName('tr').length;
            td1.innerHTML=index.toString();
            var td3 = document.createElement('td');
            if (resources[r].url.indexOf(".js") > -1) {
                td3.innerHTML=resources[r].url;
            } else {
                continue;
            }
            var td2 = document.createElement('td');
            td2.innerHTML=td3.innerHTML.split("/").pop().split(".js")[0]+".js";


            //td3.innerHTML="Something";
            tr.appendChild(td1);
            tr.appendChild(td2);
            tr.appendChild(td3);
            tbody.appendChild(tr);
        }
        btn.className = "small button secondary disabled";
    });
};