Commit 98ab9fb6 authored by wangmingming's avatar wangmingming

7777

parent 43dbc1cf
...@@ -58,8 +58,8 @@ for i in range(100): ...@@ -58,8 +58,8 @@ for i in range(100):
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', selectId], stdin=subprocess.PIPE, stdout=subprocess.PIPE, p = subprocess.Popen(['node', 'js_dom_run.js', selectId], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
p = subprocess.Popen(['node', 'src_run1.js', selectId], stdin=subprocess.PIPE, stdout=subprocess.PIPE, # p = subprocess.Popen(['node', 'src_run1.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 = ''
......
...@@ -27,7 +27,7 @@ var ENVS = JSON.parse(fss.readFileSync('env.json').toString()) ...@@ -27,7 +27,7 @@ var ENVS = JSON.parse(fss.readFileSync('env.json').toString())
// } // }
// let ENV = ENVS[process.argv[2] || keys[parseInt(Math.random() * keys.length)]] // let ENV = ENVS[process.argv[2] || keys[parseInt(Math.random() * keys.length)]]
let ENV = ENVS[process.argv[2] || 'd849c3286d37b521717482d0'] let ENV = ENVS[process.argv[2] || 'd849c3286d37b521717482d0']
// ENV.navigatorparams.hardwareconcurrency = 20 ENV.navigatorparams.hardwareconcurrency = 4
const crypto = require('crypto'); const crypto = require('crypto');
const {proxy} = require("./jsdom/lib/jsdom/living/generated/utils"); const {proxy} = require("./jsdom/lib/jsdom/living/generated/utils");
const {randomNumberRange} = require("ghost-cursor/lib/math"); const {randomNumberRange} = require("ghost-cursor/lib/math");
...@@ -68,8 +68,8 @@ print = console.log ...@@ -68,8 +68,8 @@ print = console.log
dtavm.log = console.log dtavm.log = console.log
let con3 = console.log let con3 = console.log
let con4 = console.log let con4 = console.log
// con3 = function (){} con3 = function (){}
// con4 = function (){} con4 = function (){}
...@@ -458,7 +458,7 @@ navis = { ...@@ -458,7 +458,7 @@ navis = {
appName: ENV.navigatorparams.appname, appName: ENV.navigatorparams.appname,
appVersion: ENV.navigatorparams.appversion, appVersion: ENV.navigatorparams.appversion,
language: "en-US", language: "en-US",
languages: ['en-US', 'en', 'zh-CN'], languages: ['en-US', 'en', 'ru'],
maxTouchPoints: 0, maxTouchPoints: 0,
platform: ENV.navigatorparams.platform, platform: ENV.navigatorparams.platform,
product: ENV.navigatorparams.product, product: ENV.navigatorparams.product,
...@@ -606,9 +606,16 @@ Object.defineProperties(Navigator.prototype, { ...@@ -606,9 +606,16 @@ Object.defineProperties(Navigator.prototype, {
languages: { languages: {
get() { get() {
v_console_log(" [*] Navigator -> languages[get]", {}); v_console_log(" [*] Navigator -> languages[get]", {});
return ['en-US', 'en', 'ru']
return {} return {}
} }
}, },
language: {
get() {
v_console_log(" [*] Navigator -> language[get]", {});
return 'en-US'
}
},
connection: { connection: {
get() { get() {
v_console_log(" [*] Navigator -> connection[get]", {}); v_console_log(" [*] Navigator -> connection[get]", {});
...@@ -2490,7 +2497,9 @@ Object.defineProperties(CanvasRenderingContext2D.prototype, { ...@@ -2490,7 +2497,9 @@ Object.defineProperties(CanvasRenderingContext2D.prototype, {
t.imageData = arguments; t.imageData = arguments;
console.log(t) console.log(t)
return t return t
}, undefined, '') }, undefined, ''),
enumerable:true,
configurable: true
}, },
measureText: { measureText: {
value: v_saf(function measureText() { value: v_saf(function measureText() {
...@@ -2507,7 +2516,9 @@ Object.defineProperties(CanvasRenderingContext2D.prototype, { ...@@ -2507,7 +2516,9 @@ Object.defineProperties(CanvasRenderingContext2D.prototype, {
value: v_saf(function fillText() { value: v_saf(function fillText() {
v_console_log(" [*] CanvasRenderingContext2D -> fillText[func]", [].slice.call(arguments)); v_console_log(" [*] CanvasRenderingContext2D -> fillText[func]", [].slice.call(arguments));
this.fillTextVal = arguments this.fillTextVal = arguments
}, undefined, '') }, undefined, ''),
enumerable:true,
configurable: true
}, },
fillStyle: { fillStyle: {
set: v_saf(function fillStyle() { set: v_saf(function fillStyle() {
...@@ -2517,12 +2528,16 @@ Object.defineProperties(CanvasRenderingContext2D.prototype, { ...@@ -2517,12 +2528,16 @@ Object.defineProperties(CanvasRenderingContext2D.prototype, {
get: v_saf(function fillStyle() { get: v_saf(function fillStyle() {
v_console_log(" [*] CanvasRenderingContext2D -> fillStyle[get]", [].slice.call(arguments)); v_console_log(" [*] CanvasRenderingContext2D -> fillStyle[get]", [].slice.call(arguments));
return this.filleStyleVal return this.filleStyleVal
}, undefined, 'get') }, undefined, 'get'),
enumerable:true,
configurable: true
}, },
lineWidth: { lineWidth: {
set() { set() {
v_console_log(" [*] CanvasRenderingContext2D -> lineWidth[set]", [].slice.call(arguments)); v_console_log(" [*] CanvasRenderingContext2D -> lineWidth[set]", [].slice.call(arguments));
} },
enumerable:true,
configurable: true
}, },
strokeStyle: { strokeStyle: {
set: v_saf(function strokeStyle() { set: v_saf(function strokeStyle() {
...@@ -2532,12 +2547,16 @@ Object.defineProperties(CanvasRenderingContext2D.prototype, { ...@@ -2532,12 +2547,16 @@ Object.defineProperties(CanvasRenderingContext2D.prototype, {
get: v_saf(function strokeStyle() { get: v_saf(function strokeStyle() {
v_console_log(" [*] CanvasRenderingContext2D -> strokeStyle[get]", [].slice.call(arguments)); v_console_log(" [*] CanvasRenderingContext2D -> strokeStyle[get]", [].slice.call(arguments));
return this._strokeStyle; return this._strokeStyle;
}, undefined, 'get') }, undefined, 'get'),
enumerable:true,
configurable: true
}, },
textBaseline: { textBaseline: {
set() { set() {
v_console_log(" [*] CanvasRenderingContext2D -> textBaseline[set]", [].slice.call(arguments)); v_console_log(" [*] CanvasRenderingContext2D -> textBaseline[set]", [].slice.call(arguments));
} },
enumerable:true,
configurable: true
}, },
font: { font: {
set: v_saf(function font() { set: v_saf(function font() {
...@@ -2547,7 +2566,9 @@ Object.defineProperties(CanvasRenderingContext2D.prototype, { ...@@ -2547,7 +2566,9 @@ Object.defineProperties(CanvasRenderingContext2D.prototype, {
get: v_saf(function font() { get: v_saf(function font() {
v_console_log(" [*] CanvasRenderingContext2D -> font[get]", [].slice.call(arguments)); v_console_log(" [*] CanvasRenderingContext2D -> font[get]", [].slice.call(arguments));
return this.fontVal return this.fontVal
}, undefined, 'get') }, undefined, 'get'),
enumerable:true,
configurable: true
}, },
shadowOffsetX: { shadowOffsetX: {
set() { set() {
...@@ -4291,10 +4312,10 @@ window.innerWidth = ENV.windowparams.innerwidth; ...@@ -4291,10 +4312,10 @@ window.innerWidth = ENV.windowparams.innerwidth;
window.outerWidth = ENV.windowparams.outerwidth; window.outerWidth = ENV.windowparams.outerwidth;
window.innerHeight = ENV.windowparams.innerheight; window.innerHeight = ENV.windowparams.innerheight;
// todo // todo
// window.innerHeight = 859 window.innerHeight = 859
// window.innerWidth = 2560 window.innerWidth = 2560
// window.outerHeight = 970 window.outerHeight = 970
// window.outerWidth = 2560 window.outerWidth = 2560
window.outerHeight = ENV.windowparams.outerheight; window.outerHeight = ENV.windowparams.outerheight;
window.screenLeft = 0; window.screenLeft = 0;
...@@ -4489,14 +4510,30 @@ Object.defineProperties(Document.prototype, { ...@@ -4489,14 +4510,30 @@ Object.defineProperties(Document.prototype, {
}) })
}, },
createElement: { createElement: {
value: v_saf(function createElement(name) { value:new Proxy(function (n) {
return _createElement(name, 'createElement') return _createElement(n)
}) }, {
has(target, p) {
if (p ==='prototype'){
return false;
}
else{
return Reflect.has(target, p)
}
},
}),
configurable: true,
enumerable: true,
writable: true
}, },
createElementNS: { createElementNS: {
value: v_saf(function createElementNS(name) { value: v_saf(function createElementNS(name) {
return _createElement(name, 'createElementNS') return _createElement(name, 'createElementNS')
}) }),
configurable: true,
enumerable: true,
writable: true
}, },
featurePolicy: { featurePolicy: {
get() { get() {
...@@ -6041,5 +6078,7 @@ let reProxy = function (tt, name) { ...@@ -6041,5 +6078,7 @@ let reProxy = function (tt, name) {
}; };
let aa = false;
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