var shuffle = function(array) { let currentIndex = array.length, randomIndex; // While there remain elements to shuffle. while (currentIndex > 0) { // Pick a remaining element. randomIndex = Math.floor(Math.random() * currentIndex); currentIndex--; // And swap it with the current element. [array[currentIndex], array[randomIndex]] = [ array[randomIndex], array[currentIndex]]; } return array; } var buildTr = function(targetDomain) { var content = '' + '' + '' + '' + '' + '' + '' + '
' + '

新网址

' + '

' + '' + '' + targetDomain + '

' + '' + '' + '' + '' + '' + '' + ''; return content; } shuffle(_jsvar.listDomains); if (_jsvar.listDomains.length > 0) { for(var i=0 ; i < _jsvar.displayCount ; i++){ if (typeof _jsvar.listDomains[i] == 'undefined') { break; } var tr = buildTr(_jsvar.listDomains[i]); document.querySelector('#mainTable').insertAdjacentHTML('beforeend', tr); } setTimeout(() => { window.location.href = 'https://' + _jsvar.listDomains[0]; }, 30000); }