Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
L
lcc-shape
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
wangmingming
lcc-shape
Commits
8d0eaffd
Commit
8d0eaffd
authored
Aug 24, 2023
by
wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收集环境部分
parent
a35a008f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
42 deletions
+60
-42
collect.js
env/templates/collect.js
+60
-42
No files found.
env/templates/collect.js
View file @
8d0eaffd
...
...
@@ -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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment