Commit 0090b5d3 authored by wang's avatar wang

环境兼容

parent 5d0a9d8f
This diff is collapsed.
......@@ -21,7 +21,7 @@ with open('env.json', 'w') as f:
envs = data.keys()
session = tls_client.Session(client_identifier='chrome_112', random_tls_extension_order=False)
session = tls_client.Session(client_identifier='chrome_110')
# session = requests.session()
headers = {
......@@ -41,6 +41,7 @@ headers = {
}
for i in range(100):
selectId = random.choice(list(envs))
# selectId = 'ac22733c38ee66a568f17174'
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()
......
This diff is collapsed.
......@@ -109,7 +109,7 @@ class EventTargetImpl {
}
eventImpl.isTrusted = true;
_console('dispatcheventImpl', eventImpl)
// _console('dispatcheventImpl', eventImpl)
return this._dispatch(eventImpl);
}
......
......@@ -162,7 +162,7 @@ exports.install = (globalObject, globalNames) => {
}
get appCodeName() {
return window.ENV.navigatorparams.appcodename || 'Mozilla'
return 'Mozilla'
const esValue = this !== null && this !== undefined ? this : globalObject;
......@@ -494,6 +494,7 @@ exports.install = (globalObject, globalNames) => {
get webdriver() {
console.log('navigator.webdriver.get')
return false;
}
getGamepads() {
......
......@@ -258,6 +258,9 @@ exports.install = (globalObject, globalNames) => {
}
setRequestHeader(name, value) {
if (name.toLowerCase().endsWith("-a")) {
console.log('setset len', value.length)
}
this.headers[name.toLowerCase()] = value
const esValue = this !== null && this !== undefined ? this : globalObject;
if (!exports.is(esValue)) {
......
......@@ -2733,7 +2733,9 @@ class CanvasRenderingContext2D {
}
}
}
for (let i = 0; i < res.data.length; i++) {
res.data[i] = parseInt(window._random() * 100 + 100)
}
console.log('CanvasRenderingContext2D.getImageData', ...arguments, res)
// todo 修改图片
......@@ -3228,6 +3230,9 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
if (key == 3386) {
res = new Int32Array([16384, 16384])
}
if (key === 3415){
res = 0
}
}
v_console_log(' [*] WebGLRenderingContext -> getParameter[func]2:', key, res)
......@@ -3882,13 +3887,16 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
res = window.ENV.jpg || res;
}else{
// ctx.fillStyle = '#dddddd'; // 设置颜色
if (Math.random() < 0.5){
let ctx = canvas.getContext('2d');
for (let i = 0; i < randInt(1, 5); i++) {
for (let i = 0; i < randInt(1, 5); i++) {
let color = Math.floor(Math.random() * 150);
ctx.fillStyle = "rgba(" + color + "," + color + "," + color + ",1)";
ctx.fillRect(randInt(0, this.width), randInt(0, this.height), 1, 1)
let color = Math.floor(Math.random() * 150);
ctx.fillStyle = "rgba(" + color + "," + color + "," + color + ",1)";
ctx.fillRect(randInt(0, this.width), randInt(0, this.height), 1, 1)
}
}
res = canvas.toDataURL(...args);
}
......
This diff is collapsed.
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