Last active
October 24, 2019 13:12
-
-
Save Danny-Engelman/d2fcd827e35c27a6e4c990adde1c524d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Open F12 Network Tab | |
Press Ctrl-Shift-I to open SECOND console window | |
Execute this script (runs in first Console window) | |
*/ | |
const rsColor='lightgreen'; | |
const rsStaticColor=rsColor; | |
const remoteColor='pink'; | |
let remoteTime=0; | |
let localTime=0; | |
let colorRequests=()=> | |
[...document.querySelectorAll('.remoteaddress-column')].map(td=>{ | |
let color=remoteColor; | |
let ip=td.textContent; | |
if (ip.length){ | |
if(ip.includes('::')) { | |
color='lightgreen'; | |
} else { | |
ip=ip.split`:`[0]; | |
if(ip.includes('52.212.193')) color=rsColor; | |
if(ip.includes('172.25')) color=rsColor; | |
//if(ip.includes('54.192.33')) color=rsStaticColor; | |
//if(ip.includes('13.224.77')) color='orange'; | |
//if(ip.includes('74.125')) color='lightyellow'; | |
} | |
let tr = td.closest('tr'); | |
let nameTD=tr.querySelector('.name-column'); | |
let name=nameTD.querySelector('DIV').textContent; | |
if(name.includes('jquery')){ | |
nameTD.innerHTML=name; | |
nameTD.style.backgroundColor='bisque'; | |
nameTD.style.color='red'; | |
} | |
console.log(name); | |
if(name.includes('nidp')) color=rsColor; | |
if(name.includes('randstad.nl')) color=rsColor; | |
if(name.includes('randstadgroep.nl')) color=rsColor; | |
let timeTD=tr.querySelector('.time-column DIV'); | |
let time=~~timeTD.textContent.replace('ms',''); | |
if(color===remoteColor){ | |
remoteTime+=time; | |
} else { | |
localTime+=time; | |
} | |
if(time>100){ | |
//timeTD.parentNode.style.backgroundColor='orange'; | |
} | |
} | |
td.style.backgroundColor=color; | |
}); | |
console.clear(); | |
colorRequests(); | |
console.log('ms',localTime,remoteTime); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment