function htmlspecialchars(str){ if(str === null){ return "<Empty>"; } var map = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' } return str.replace(/[&<>"']/g, function(m){return map[m];}); } // initialize garbage var list = []; var pinged_list = []; var reqs = 0; var errors = 0; var sort = 6; // highest version first // check for instance redirect stuff var redir = []; var target = "/web?"; new URL(window.location.href) .searchParams .forEach( function(value, key){ if(key == "target"){ target = "/" + encodeURIComponent(value) + "?"; return; } if(key == "npt"){ return; } redir.push(encodeURIComponent(key) + "=" + encodeURIComponent(value)) } ); if(redir.length !== 0){ redir = target + redir.join("&"); }else{ redir = ""; } var quote = document.createElement("div"); quote.className = "quote"; quote.innerHTML = 'Pinged 0 servers (0 failed requests)'; var [div_servercount, div_failedreqs] = quote.getElementsByTagName("b"); var noscript = document.getElementsByTagName("noscript")[0]; document.body.insertBefore(quote, noscript.nextSibling); // create table var table = document.createElement("table"); table.innerHTML = '' + '' + 'Server' + 'Address' + 'Bot protection' + 'Real reqs (?)' + 'Bot reqs (?)' + 'API' + '
Version' + '' + '' + ''; document.body.insertBefore(table, quote.nextSibling); // handle sorting clicks var tbody = table.getElementsByTagName("tbody")[0]; var th = table.getElementsByTagName("th"); for(var i=0; i'; for(var i=0; i<7; i++){ html += '' + 'Description' + '
' + htmlspecialchars(pinged_list[serverid].server.description) + '
'; var url_obj = new URL(pinged_list[serverid].server.ip); var url = htmlspecialchars(url_obj.origin); var domain = url_obj.hostname; html += 'URL: ' + url + ' (IP lookup)' + '

Alt addresses:'; var len = pinged_list[serverid].server.alt_addresses.length; if(len === 0){ html += ' <Empty>'; }else{ html += ''; } popup.innerHTML = html; popup_wrapper.style.display = "block"; popup_bg.style.display = "block"; } function hide_server(){ popup_wrapper.style.display = "none"; popup_bg.style.display = "none"; }