Commit c4c532a2 authored by wang's avatar wang

收集环境部分

parent 8cefbbe3
This diff is collapsed.
...@@ -693,7 +693,7 @@ for (let i = 0; i < glARgs.length; i++) { ...@@ -693,7 +693,7 @@ for (let i = 0; i < glARgs.length; i++) {
delete canvas delete canvas
let navigatorParams = { let navigatorparams = {
appName: navigator.appName, appName: navigator.appName,
appVersion: navigator.appVersion, appVersion: navigator.appVersion,
hardwareConcurrency: navigator.hardwareConcurrency, hardwareConcurrency: navigator.hardwareConcurrency,
...@@ -707,7 +707,7 @@ let navigatorParams = { ...@@ -707,7 +707,7 @@ let navigatorParams = {
doNotTrack: navigator.doNotTrack, doNotTrack: navigator.doNotTrack,
} }
let screenParams = { let screenparams = {
height: screen.height, height: screen.height,
width: screen.width, width: screen.width,
availHeight: screen.availHeight, availHeight: screen.availHeight,
...@@ -724,7 +724,7 @@ if (document.featurePolicy) { ...@@ -724,7 +724,7 @@ if (document.featurePolicy) {
allowedFeatures: document.featurePolicy.allowedFeatures(), allowedFeatures: document.featurePolicy.allowedFeatures(),
} }
} }
let windowParams = { let windowparams = {
innerHeight: window.innerHeight, innerHeight: window.innerHeight,
innerWidth: window.innerWidth, innerWidth: window.innerWidth,
outerHeight: window.outerHeight, outerHeight: window.outerHeight,
...@@ -949,9 +949,9 @@ webglImg = function (){ ...@@ -949,9 +949,9 @@ webglImg = function (){
}() }()
setTimeout(function (){ setTimeout(function (){
let result = { let result = {
windowParams: windowParams, windowparams: windowparams,
screenParams: screenParams, screenparams: screenparams,
navigatorParams: navigatorParams, navigatorparams: navigatorparams,
featurePolicy: featurePolicy, featurePolicy: featurePolicy,
plugins: plgs, plugins: plgs,
mimeTypes: mimes, mimeTypes: mimes,
...@@ -970,8 +970,9 @@ setTimeout(function (){ ...@@ -970,8 +970,9 @@ setTimeout(function (){
// console.log(2, body.length) // console.log(2, body.length)
// /collect // /collect
fetch("https://stage.unififi.com/env/shape", { // fetch("https://stage.unififi.com/env/shape", {
// fetch("http://127.0.0.1:39999/env/shape", { // fetch("http://127.0.0.1:39999/env/shape", {
fetch("/collect", {
"headers": { "headers": {
"accept": "*/*", "accept": "*/*",
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7", "accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7",
......
...@@ -5,6 +5,22 @@ import requests ...@@ -5,6 +5,22 @@ import requests
import json import json
import tls_client import tls_client
from pymongo import MongoClient
# 连接MongoDB数据库
client = MongoClient('mongodb://lcc-spider:JIUsfhiad&^@18.144.59.80:27017/?authSource=admin&directConnection=true')
db = client.env
# 查询所有文档
result = db.env_shape.find()
data = {str(x['_id']): x['env'] for x in result}
print(result)
with open('env.json', 'w') as f:
f.write(json.dumps(data))
envs = data.keys()
session = tls_client.Session(client_identifier='chrome_112', random_tls_extension_order=False) session = tls_client.Session(client_identifier='chrome_112', random_tls_extension_order=False)
# session = requests.session() # session = requests.session()
...@@ -24,11 +40,11 @@ headers = { ...@@ -24,11 +40,11 @@ headers = {
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7" "accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7"
} }
for i in range(100): for i in range(100):
selectId = random.choice(list(envs))
t1 = time.time() t1 = time.time()
# r = requests.get('http://127.0.0.1:5000/getinfo').json()['message'] # r = requests.get('http://127.0.0.1:5000/getinfo').json()['message']
# r = requests.get('http://127.0.0.1:3001').json() # r = requests.get('http://127.0.0.1:3001').json()
p = subprocess.Popen(['node', 'js_dom_run.js'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, p = subprocess.Popen(['node', 'js_dom_run.js', selectId], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE) stderr=subprocess.PIPE)
output, err = p.communicate(timeout=10) output, err = p.communicate(timeout=10)
tmp = '' tmp = ''
...@@ -94,7 +110,7 @@ for i in range(100): ...@@ -94,7 +110,7 @@ for i in range(100):
# }) # })
uri = 'http://ymx-lcc.unififi.com/header/add' uri = 'http://ymx-lcc.unififi.com/header/add'
print(headers) print(selectId, headers)
r = requests.post(uri, json={ r = requests.post(uri, json={
'brush_fromto': 'LAS-BOS', 'brush_fromto': 'LAS-BOS',
'brush_fromdate': '2023-05-22', 'brush_fromdate': '2023-05-22',
......
This diff is collapsed.
...@@ -242,13 +242,13 @@ exports.install = (globalObject, globalNames) => { ...@@ -242,13 +242,13 @@ exports.install = (globalObject, globalNames) => {
Object.defineProperties(FeaturePolicy.prototype, { Object.defineProperties(FeaturePolicy.prototype, {
features: { features: {
value: function (){ value: function (){
return window.ENV.featurePolicy.features return window.ENV.featurepolicy.features
}, },
enumerable: true enumerable: true
}, },
allowedFeatures: { allowedFeatures: {
value: function (){ value: function (){
return window.ENV.featurePolicy.allowedFeatures return window.ENV.featurepolicy.allowedfeatures
}, },
enumerable: true enumerable: true
}, },
......
...@@ -138,7 +138,7 @@ exports.install = (globalObject, globalNames) => { ...@@ -138,7 +138,7 @@ exports.install = (globalObject, globalNames) => {
} }
let res = utils.tryWrapperForImpl(esValue[implSymbol].canPlayType(...args)); let res = utils.tryWrapperForImpl(esValue[implSymbol].canPlayType(...args));
window.videos.push(type) window.videos.push(type)
if (window.ENV.canPlay[type]){ if (window.ENV.canplay[type]){
res = videos[type] res = videos[type]
} }
console.log('canPlayType', type, res) console.log('canPlayType', type, res)
......
...@@ -162,7 +162,7 @@ exports.install = (globalObject, globalNames) => { ...@@ -162,7 +162,7 @@ exports.install = (globalObject, globalNames) => {
} }
get appCodeName() { get appCodeName() {
return window.ENV.navigatorParams.appCodeName return window.ENV.navigatorparams.appCodeName
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
...@@ -174,7 +174,7 @@ exports.install = (globalObject, globalNames) => { ...@@ -174,7 +174,7 @@ exports.install = (globalObject, globalNames) => {
} }
get appName() { get appName() {
return window.ENV.navigatorParams.appName return window.ENV.navigatorparams.appName
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
...@@ -186,7 +186,7 @@ exports.install = (globalObject, globalNames) => { ...@@ -186,7 +186,7 @@ exports.install = (globalObject, globalNames) => {
} }
get appVersion() { get appVersion() {
return window.ENV.navigatorParams.appVersion return window.ENV.navigatorparams.appVersion
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
...@@ -198,7 +198,7 @@ exports.install = (globalObject, globalNames) => { ...@@ -198,7 +198,7 @@ exports.install = (globalObject, globalNames) => {
} }
get platform() { get platform() {
return window.ENV.navigatorParams.platform return window.ENV.navigatorparams.platform
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
if (!exports.is(esValue)) { if (!exports.is(esValue)) {
...@@ -209,7 +209,7 @@ exports.install = (globalObject, globalNames) => { ...@@ -209,7 +209,7 @@ exports.install = (globalObject, globalNames) => {
} }
get product() { get product() {
return window.ENV.navigatorParams.product return window.ENV.navigatorparams.product
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
...@@ -221,7 +221,7 @@ exports.install = (globalObject, globalNames) => { ...@@ -221,7 +221,7 @@ exports.install = (globalObject, globalNames) => {
} }
get productSub() { get productSub() {
return window.ENV.navigatorParams.productSub return window.ENV.navigatorparams.productSub
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
...@@ -373,7 +373,7 @@ exports.install = (globalObject, globalNames) => { ...@@ -373,7 +373,7 @@ exports.install = (globalObject, globalNames) => {
get userAgent() { get userAgent() {
return 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36'; return 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36';
return window.ENV.navigatorParams.userAgent return window.ENV.navigatorparams.userAgent
// return window.browser.ua; // return window.browser.ua;
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
...@@ -386,7 +386,7 @@ exports.install = (globalObject, globalNames) => { ...@@ -386,7 +386,7 @@ exports.install = (globalObject, globalNames) => {
} }
get vendor() { get vendor() {
return window.ENV.navigatorParams.vendor return window.ENV.navigatorparams.vendor
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
...@@ -398,7 +398,7 @@ exports.install = (globalObject, globalNames) => { ...@@ -398,7 +398,7 @@ exports.install = (globalObject, globalNames) => {
} }
get vendorSub() { get vendorSub() {
return window.ENV.navigatorParams.vendorSub return window.ENV.navigatorparams.vendorSub
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
...@@ -410,7 +410,7 @@ exports.install = (globalObject, globalNames) => { ...@@ -410,7 +410,7 @@ exports.install = (globalObject, globalNames) => {
} }
get language() { get language() {
return window.ENV.navigatorParams.language || return window.ENV.navigatorparams.language ||
"en-US" "en-US"
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
...@@ -423,7 +423,7 @@ exports.install = (globalObject, globalNames) => { ...@@ -423,7 +423,7 @@ exports.install = (globalObject, globalNames) => {
} }
get languages() { get languages() {
return window.ENV.navigatorParams.languages || [ return window.ENV.navigatorparams.languages || [
"en-US", "en-US",
"en", "en",
"zh-CN", "zh-CN",
...@@ -439,7 +439,7 @@ exports.install = (globalObject, globalNames) => { ...@@ -439,7 +439,7 @@ exports.install = (globalObject, globalNames) => {
} }
get onLine() { get onLine() {
// return window.ENV.navigatorParams.onLine // return window.ENV.navigatorparams.onLine
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
...@@ -463,7 +463,7 @@ exports.install = (globalObject, globalNames) => { ...@@ -463,7 +463,7 @@ exports.install = (globalObject, globalNames) => {
get hardwareConcurrency() { get hardwareConcurrency() {
return window.ENV.navigatorParams.hardwareConcurrency return window.ENV.navigatorparams.hardwareConcurrency
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
......
...@@ -92,9 +92,9 @@ exports.install = (globalObject, globalNames) => { ...@@ -92,9 +92,9 @@ exports.install = (globalObject, globalNames) => {
} }
get availWidth() { get availWidth() {
console.log('availWidth', window.ENV.screenParams.availWidth) console.log('availWidth', window.ENV.screenparams.availwidth)
// return 1920; // return 1920;
return window.ENV.screenParams.availWidth; return window.ENV.screenparams.availwidth;
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
...@@ -106,9 +106,9 @@ exports.install = (globalObject, globalNames) => { ...@@ -106,9 +106,9 @@ exports.install = (globalObject, globalNames) => {
} }
get availHeight() { get availHeight() {
console.log('availHeight', window.ENV.screenParams.availHeight) console.log('availHeight', window.ENV.screenparams.availheight)
// return 1080; // return 1080;
return window.ENV.screenParams.availHeight; return window.ENV.screenparams.availheight;
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
...@@ -120,9 +120,9 @@ exports.install = (globalObject, globalNames) => { ...@@ -120,9 +120,9 @@ exports.install = (globalObject, globalNames) => {
} }
get width() { get width() {
console.log('width', window.ENV.screenParams.width) console.log('width', window.ENV.screenparams.width)
return window.ENV.screenParams.width; return window.ENV.screenparams.width;
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
...@@ -134,9 +134,9 @@ exports.install = (globalObject, globalNames) => { ...@@ -134,9 +134,9 @@ exports.install = (globalObject, globalNames) => {
} }
get height() { get height() {
console.log('height', window.ENV.screenParams.height) console.log('height', window.ENV.screenparams.height)
return window.ENV.screenParams.height; return window.ENV.screenparams.height;
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
...@@ -148,7 +148,7 @@ exports.install = (globalObject, globalNames) => { ...@@ -148,7 +148,7 @@ exports.install = (globalObject, globalNames) => {
} }
get colorDepth() { get colorDepth() {
return window.ENV.screenParams.colorDepth; return window.ENV.screenparams.colordepth;
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
...@@ -160,7 +160,7 @@ exports.install = (globalObject, globalNames) => { ...@@ -160,7 +160,7 @@ exports.install = (globalObject, globalNames) => {
} }
get pixelDepth() { get pixelDepth() {
return window.ENV.screenParams.pixelDepth; return window.ENV.screenparams.pixeldepth;
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
if (!exports.is(esValue)) { if (!exports.is(esValue)) {
...@@ -171,55 +171,55 @@ exports.install = (globalObject, globalNames) => { ...@@ -171,55 +171,55 @@ exports.install = (globalObject, globalNames) => {
} }
get availTop() { get availTop() {
return window.ENV.screenParams.availTop return window.ENV.screenparams.availtop
} }
get availLeft() { get availLeft() {
return window.ENV.screenParams.availLeft return window.ENV.screenparams.availleft
} }
get innerHeight() { get innerHeight() {
return window.ENV.screenParams.innerHeight return window.ENV.screenparams.innerheight
} }
get outerHeight() { get outerHeight() {
return window.ENV.screenParams.outerHeight return window.ENV.screenparams.outerheight
} }
get outerWidth() { get outerWidth() {
return window.ENV.screenParams.outerWidth return window.ENV.screenparams.outerwidth
} }
get innerWidth() { get innerWidth() {
return window.ENV.screenParams.innerWidth return window.ENV.screenparams.innerwidth
} }
get screenX() { get screenX() {
return window.ENV.screenParams.screenX return window.ENV.screenparams.screenx
} }
get pageXOffset() { get pageXOffset() {
return window.ENV.screenParams.pageXOffset return window.ENV.screenparams.pagexoffset
} }
get pageYOffset() { get pageYOffset() {
return window.ENV.screenParams.pageYOffset return window.ENV.screenparams.pageyoffset
} }
get devicePixelRatio() { get devicePixelRatio() {
return window.ENV.screenParams.devicePixelRatio return window.ENV.screenparams.devicepixelratio
} }
get clientWidth() { get clientWidth() {
return window.ENV.screenParams.clientWidth return window.ENV.screenparams.clientwidth
} }
get clientHeight() { get clientHeight() {
return window.ENV.screenParams.clientHeight return window.ENV.screenparams.clientheight
} }
get hasHDR() { get hasHDR() {
return window.ENV.screenParams.hasHDR return window.ENV.screenparams.hashdr
} }
} }
......
...@@ -2308,7 +2308,7 @@ class TextMetrics { ...@@ -2308,7 +2308,7 @@ class TextMetrics {
this._context = context this._context = context
// this._TextMetrics = context.measureText(text) // this._TextMetrics = context.measureText(text)
try { try {
metrics = window.ENV.fontsRes metrics = window.ENV.fontsres
this._TextMetrics = metrics[this._font][this._text] this._TextMetrics = metrics[this._font][this._text]
} catch (e) { } catch (e) {
console.log('_TextMetrics', this._text, this._font) console.log('_TextMetrics', this._text, this._font)
...@@ -2394,7 +2394,7 @@ class CanvasRenderingContext2D { ...@@ -2394,7 +2394,7 @@ class CanvasRenderingContext2D {
"37,17,1,1": [0, 0, 0, 255], "37,17,1,1": [0, 0, 0, 255],
"62,28,1,1": [204, 131, 217, 255] "62,28,1,1": [204, 131, 217, 255]
} }
imageDatas = window.ENV.imgsRes['94px sans-serif'] imageDatas = window.ENV.imgsres['94px sans-serif']
constructor(w, h, context) { constructor(w, h, context) {
console.log('OffscreenCanvasRenderingContext2D.new', w, h) console.log('OffscreenCanvasRenderingContext2D.new', w, h)
this.width = w; this.width = w;
...@@ -3201,7 +3201,7 @@ class HTMLCanvasElementImpl extends HTMLElementImpl { ...@@ -3201,7 +3201,7 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
37446: window.GRAPHIC_DRIVER, 37446: window.GRAPHIC_DRIVER,
34047: 16 34047: 16
} }
_toggle = window.ENV.glRes; _toggle = window.ENV.glres;
if (_toggle[key]) { if (_toggle[key]) {
res = _toggle[key] res = _toggle[key]
......
This diff is collapsed.
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