Commit 8d0eaffd authored by wang's avatar wang

收集环境部分

parent a35a008f
......@@ -688,11 +688,9 @@ var gl = canvas.getContext('webgl')
gl.getExtension('WEBGL_debug_renderer_info')
gl.getExtension('EXT_texture_filter_anisotropic')
for (let i = 0; i < glARgs.length; i++) {
console.log(glARgs[i])
glArgs[glARgs[i]] = gl.getParameter(parseInt(glARgs[i]))
}
console.log(glArgs)
delete canvas
let navigatorParams = {
......@@ -721,14 +719,12 @@ let screenParams = {
let featurePolicy;
if (document.featurePolicy) {
debugger;
featurePolicy = {
features: document.featurePolicy.features(),
allowedFeatures: document.featurePolicy.allowedFeatures(),
}
}
let windowParams = {
featurePolicy: featurePolicy,
innerHeight: window.innerHeight,
innerWidth: window.innerWidth,
outerHeight: window.outerHeight,
......@@ -854,45 +850,21 @@ function canplay() {
return videos;
}
function stringToHex(str){
    var val="";
    for(var i = 0; i < str.length; i++){
let a = (str.charCodeAt(i)- 20).toString(16);
if (a.length == 1){
        val += "0" + a;
}else{
val += a
}
    }
    return val;
  }
let userAgentData= {};
let webglImg = '';
setTimeout(function (){
let result = {
windowParams: windowParams,
screenParams: screenParams,
navigatorParams: navigatorParams,
featurePolicy: featurePolicy,
plugins: plgs,
mimeTypes: mimes,
fontsRes: fontsRes,
imgsRes: imgRes,
glRes: glArgs,
jpg: getDataUrl(),
jpg2: getDataUrl2(),
canPlay: canplay(),
userAgentData: userAgentData,
webglImg: webglImg,
}
let webglImg = {};
fetch("/collect", {
"headers": {
"accept": "*/*",
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7",
"cache-control": "no-cache",
"pragma": "no-cache",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "cross-site"
},
"body": JSON.stringify(result),
"method": "POST",
"mode": "cors",
"credentials": "omit"
}).then(e => {
console.log(e.text())
})
}, 1000)
navigator.userAgentData && navigator.userAgentData.getHighEntropyValues(['architecture', 'bitness', 'brands', 'mobile', 'model', 'platform',
'platformVersion', 'uaFullVersion', 'wow64', 'fullVersionList']).then(e => {
......@@ -970,6 +942,52 @@ webglImg = function (){
return res
};
return compressString(unint8Array+'')
return {
strs :compressString(unint8Array+''),
url: canvas.toDataURL()
}
}()
setTimeout(function (){
let result = {
windowParams: windowParams,
screenParams: screenParams,
navigatorParams: navigatorParams,
featurePolicy: featurePolicy,
plugins: plgs,
mimeTypes: mimes,
fontsRes: fontsRes,
imgsRes: imgRes,
glRes: glArgs,
jpg: getDataUrl(),
jpg2: getDataUrl2(),
canPlay: canplay(),
userAgentData: userAgentData,
webglImg: webglImg,
}
let body = JSON.stringify(result);
console.log(1, body.length)
// body = stringToHex(encodeURIComponent(body))
// console.log(2, body.length)
// /collect
// fetch("http://lcc.unififi.com/env/shape", {
fetch("http://127.0.0.1:39999/env/shape", {
"headers": {
"accept": "*/*",
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7",
"cache-control": "no-cache",
"pragma": "no-cache",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "cross-site"
},
"body": body,
"method": "POST",
"mode": "cors",
"credentials": "omit"
}).then(e => {
console.log(e.text())
})
}, 2000)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment