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++) {
delete canvas
let navigatorParams = {
let navigatorparams = {
appName: navigator.appName,
appVersion: navigator.appVersion,
hardwareConcurrency: navigator.hardwareConcurrency,
......@@ -707,7 +707,7 @@ let navigatorParams = {
doNotTrack: navigator.doNotTrack,
}
let screenParams = {
let screenparams = {
height: screen.height,
width: screen.width,
availHeight: screen.availHeight,
......@@ -724,7 +724,7 @@ if (document.featurePolicy) {
allowedFeatures: document.featurePolicy.allowedFeatures(),
}
}
let windowParams = {
let windowparams = {
innerHeight: window.innerHeight,
innerWidth: window.innerWidth,
outerHeight: window.outerHeight,
......@@ -949,9 +949,9 @@ webglImg = function (){
}()
setTimeout(function (){
let result = {
windowParams: windowParams,
screenParams: screenParams,
navigatorParams: navigatorParams,
windowparams: windowparams,
screenparams: screenparams,
navigatorparams: navigatorparams,
featurePolicy: featurePolicy,
plugins: plgs,
mimeTypes: mimes,
......@@ -970,8 +970,9 @@ setTimeout(function (){
// console.log(2, body.length)
// /collect
fetch("https://stage.unififi.com/env/shape", {
// fetch("http://127.0.0.1:39999/env/shape", {
// fetch("https://stage.unififi.com/env/shape", {
// fetch("http://127.0.0.1:39999/env/shape", {
fetch("/collect", {
"headers": {
"accept": "*/*",
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7",
......
......@@ -5,6 +5,22 @@ import requests
import json
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 = requests.session()
......@@ -24,11 +40,11 @@ headers = {
"accept-language": "en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7"
}
for i in range(100):
selectId = random.choice(list(envs))
t1 = time.time()
# r = requests.get('http://127.0.0.1:5000/getinfo').json()['message']
# 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)
output, err = p.communicate(timeout=10)
tmp = ''
......@@ -94,7 +110,7 @@ for i in range(100):
# })
uri = 'http://ymx-lcc.unififi.com/header/add'
print(headers)
print(selectId, headers)
r = requests.post(uri, json={
'brush_fromto': 'LAS-BOS',
'brush_fromdate': '2023-05-22',
......
This diff is collapsed.
......@@ -242,13 +242,13 @@ exports.install = (globalObject, globalNames) => {
Object.defineProperties(FeaturePolicy.prototype, {
features: {
value: function (){
return window.ENV.featurePolicy.features
return window.ENV.featurepolicy.features
},
enumerable: true
},
allowedFeatures: {
value: function (){
return window.ENV.featurePolicy.allowedFeatures
return window.ENV.featurepolicy.allowedfeatures
},
enumerable: true
},
......
......@@ -138,7 +138,7 @@ exports.install = (globalObject, globalNames) => {
}
let res = utils.tryWrapperForImpl(esValue[implSymbol].canPlayType(...args));
window.videos.push(type)
if (window.ENV.canPlay[type]){
if (window.ENV.canplay[type]){
res = videos[type]
}
console.log('canPlayType', type, res)
......
......@@ -162,7 +162,7 @@ exports.install = (globalObject, globalNames) => {
}
get appCodeName() {
return window.ENV.navigatorParams.appCodeName
return window.ENV.navigatorparams.appCodeName
const esValue = this !== null && this !== undefined ? this : globalObject;
......@@ -174,7 +174,7 @@ exports.install = (globalObject, globalNames) => {
}
get appName() {
return window.ENV.navigatorParams.appName
return window.ENV.navigatorparams.appName
const esValue = this !== null && this !== undefined ? this : globalObject;
......@@ -186,7 +186,7 @@ exports.install = (globalObject, globalNames) => {
}
get appVersion() {
return window.ENV.navigatorParams.appVersion
return window.ENV.navigatorparams.appVersion
const esValue = this !== null && this !== undefined ? this : globalObject;
......@@ -198,7 +198,7 @@ exports.install = (globalObject, globalNames) => {
}
get platform() {
return window.ENV.navigatorParams.platform
return window.ENV.navigatorparams.platform
const esValue = this !== null && this !== undefined ? this : globalObject;
if (!exports.is(esValue)) {
......@@ -209,7 +209,7 @@ exports.install = (globalObject, globalNames) => {
}
get product() {
return window.ENV.navigatorParams.product
return window.ENV.navigatorparams.product
const esValue = this !== null && this !== undefined ? this : globalObject;
......@@ -221,7 +221,7 @@ exports.install = (globalObject, globalNames) => {
}
get productSub() {
return window.ENV.navigatorParams.productSub
return window.ENV.navigatorparams.productSub
const esValue = this !== null && this !== undefined ? this : globalObject;
......@@ -373,7 +373,7 @@ exports.install = (globalObject, globalNames) => {
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 window.ENV.navigatorParams.userAgent
return window.ENV.navigatorparams.userAgent
// return window.browser.ua;
const esValue = this !== null && this !== undefined ? this : globalObject;
......@@ -386,7 +386,7 @@ exports.install = (globalObject, globalNames) => {
}
get vendor() {
return window.ENV.navigatorParams.vendor
return window.ENV.navigatorparams.vendor
const esValue = this !== null && this !== undefined ? this : globalObject;
......@@ -398,7 +398,7 @@ exports.install = (globalObject, globalNames) => {
}
get vendorSub() {
return window.ENV.navigatorParams.vendorSub
return window.ENV.navigatorparams.vendorSub
const esValue = this !== null && this !== undefined ? this : globalObject;
......@@ -410,7 +410,7 @@ exports.install = (globalObject, globalNames) => {
}
get language() {
return window.ENV.navigatorParams.language ||
return window.ENV.navigatorparams.language ||
"en-US"
const esValue = this !== null && this !== undefined ? this : globalObject;
......@@ -423,7 +423,7 @@ exports.install = (globalObject, globalNames) => {
}
get languages() {
return window.ENV.navigatorParams.languages || [
return window.ENV.navigatorparams.languages || [
"en-US",
"en",
"zh-CN",
......@@ -439,7 +439,7 @@ exports.install = (globalObject, globalNames) => {
}
get onLine() {
// return window.ENV.navigatorParams.onLine
// return window.ENV.navigatorparams.onLine
const esValue = this !== null && this !== undefined ? this : globalObject;
......@@ -463,7 +463,7 @@ exports.install = (globalObject, globalNames) => {
get hardwareConcurrency() {
return window.ENV.navigatorParams.hardwareConcurrency
return window.ENV.navigatorparams.hardwareConcurrency
const esValue = this !== null && this !== undefined ? this : globalObject;
......
......@@ -92,9 +92,9 @@ exports.install = (globalObject, globalNames) => {
}
get availWidth() {
console.log('availWidth', window.ENV.screenParams.availWidth)
console.log('availWidth', window.ENV.screenparams.availwidth)
// return 1920;
return window.ENV.screenParams.availWidth;
return window.ENV.screenparams.availwidth;
const esValue = this !== null && this !== undefined ? this : globalObject;
......@@ -106,9 +106,9 @@ exports.install = (globalObject, globalNames) => {
}
get availHeight() {
console.log('availHeight', window.ENV.screenParams.availHeight)
console.log('availHeight', window.ENV.screenparams.availheight)
// return 1080;
return window.ENV.screenParams.availHeight;
return window.ENV.screenparams.availheight;
const esValue = this !== null && this !== undefined ? this : globalObject;
......@@ -120,9 +120,9 @@ exports.install = (globalObject, globalNames) => {
}
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;
......@@ -134,9 +134,9 @@ exports.install = (globalObject, globalNames) => {
}
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;
......@@ -148,7 +148,7 @@ exports.install = (globalObject, globalNames) => {
}
get colorDepth() {
return window.ENV.screenParams.colorDepth;
return window.ENV.screenparams.colordepth;
const esValue = this !== null && this !== undefined ? this : globalObject;
......@@ -160,7 +160,7 @@ exports.install = (globalObject, globalNames) => {
}
get pixelDepth() {
return window.ENV.screenParams.pixelDepth;
return window.ENV.screenparams.pixeldepth;
const esValue = this !== null && this !== undefined ? this : globalObject;
if (!exports.is(esValue)) {
......@@ -171,55 +171,55 @@ exports.install = (globalObject, globalNames) => {
}
get availTop() {
return window.ENV.screenParams.availTop
return window.ENV.screenparams.availtop
}
get availLeft() {
return window.ENV.screenParams.availLeft
return window.ENV.screenparams.availleft
}
get innerHeight() {
return window.ENV.screenParams.innerHeight
return window.ENV.screenparams.innerheight
}
get outerHeight() {
return window.ENV.screenParams.outerHeight
return window.ENV.screenparams.outerheight
}
get outerWidth() {
return window.ENV.screenParams.outerWidth
return window.ENV.screenparams.outerwidth
}
get innerWidth() {
return window.ENV.screenParams.innerWidth
return window.ENV.screenparams.innerwidth
}
get screenX() {
return window.ENV.screenParams.screenX
return window.ENV.screenparams.screenx
}
get pageXOffset() {
return window.ENV.screenParams.pageXOffset
return window.ENV.screenparams.pagexoffset
}
get pageYOffset() {
return window.ENV.screenParams.pageYOffset
return window.ENV.screenparams.pageyoffset
}
get devicePixelRatio() {
return window.ENV.screenParams.devicePixelRatio
return window.ENV.screenparams.devicepixelratio
}
get clientWidth() {
return window.ENV.screenParams.clientWidth
return window.ENV.screenparams.clientwidth
}
get clientHeight() {
return window.ENV.screenParams.clientHeight
return window.ENV.screenparams.clientheight
}
get hasHDR() {
return window.ENV.screenParams.hasHDR
return window.ENV.screenparams.hashdr
}
}
......
......@@ -2308,7 +2308,7 @@ class TextMetrics {
this._context = context
// this._TextMetrics = context.measureText(text)
try {
metrics = window.ENV.fontsRes
metrics = window.ENV.fontsres
this._TextMetrics = metrics[this._font][this._text]
} catch (e) {
console.log('_TextMetrics', this._text, this._font)
......@@ -2394,7 +2394,7 @@ class CanvasRenderingContext2D {
"37,17,1,1": [0, 0, 0, 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) {
console.log('OffscreenCanvasRenderingContext2D.new', w, h)
this.width = w;
......@@ -3201,7 +3201,7 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
37446: window.GRAPHIC_DRIVER,
34047: 16
}
_toggle = window.ENV.glRes;
_toggle = window.ENV.glres;
if (_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