Commit d5db4145 authored by wangmingming's avatar wangmingming

333

parent 52882e94
This diff is collapsed.
......@@ -265,13 +265,13 @@ function Window(options) {
// debugger;
// }
let res = Reflect.get(target, p, receiver);
if (p !== 'debug'){
if (p !== 'debug' && p !== 'Object'){
console.log('window get', p, typeof res)
}
if (p === 'offsetHeight'){
debugger;
}
// if (p === 'offsetHeight'){
// debugger;
// }
// console.log(Reflect.get(target, '_cf_chl_ctx', receiver))
if (!['_registeredHandlers', 'window', '_currentEvent', 'performance','debug','_eventListenerss','top'].includes(p) && res && typeof res === 'object' && typeof p !== 'symbol') {
......
......@@ -306,7 +306,7 @@ function innerInvokeEventListeners(eventImpl, listeners, phase, itemInShadowTree
return found;
}
if (type === 'mousemove'){
debugger
// debugger
}
// Copy event listeners before iterating since the list can be modified during the iteration.
const handlers = listeners[type].slice();
......
......@@ -185,7 +185,7 @@ exports.install = (globalObject, globalNames) => {
getHighEntropyValues: function (e) {
console.log('getHighEntropyValues', e)
let r;
switch (e) {
switch (e[0]) {
case 'architecture':
r = {
"architecture": "arm",
......@@ -227,20 +227,10 @@ exports.install = (globalObject, globalNames) => {
}
break;
case 'mobile':
r = {
"brands": [{"brand": "Not/A)Brand", "version": "99"}, {
"brand": "Google Chrome",
"version": "115"
}, {"brand": "Chromium", "version": "115"}], "mobile": false, "platform": "macOS"
}
r = {"brands":[{"brand":"Not.A/Brand","version":"8"},{"brand":"Chromium","version":"114"},{"brand":"Google Chrome","version":"114"}],"mobile":false,"platform":"macOS"}
break;
case 'model':
r = {
"brands": [{"brand": "Not/A)Brand", "version": "99"}, {
"brand": "Google Chrome",
"version": "115"
}, {"brand": "Chromium", "version": "115"}], "mobile": false, "platform": "macOS"
}
r = {"brands":[{"brand":"Not.A/Brand","version":"8"},{"brand":"Chromium","version":"114"},{"brand":"Google Chrome","version":"114"}],"mobile":false,"model":"","platform":"macOS"}
break;
case 'platform':
r = {
......@@ -273,6 +263,12 @@ exports.install = (globalObject, globalNames) => {
}
return {
then: function (){
return r
}
}
}
}
}
......
......@@ -51,6 +51,7 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
}
getContext(contextId) {
// console.log('contextId', contextId)
const canvas = this._getCanvas();
if (canvas) {
if (!this._context) {
......@@ -66,7 +67,7 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
wrapNodeCanvasMethod(this._context, "drawImage");
}
}
if (contextId === 'webgl') {
if (contextId === 'webgl' || contextId === 'webgl2') {
var v_new_toggle = true
var v_new = function (v) {
var temp = v_new_toggle;
......@@ -91,7 +92,6 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
function WebGLShader() {
}
this._toggle = {}
this.createBuffer = function () {
v_console_log(' [*] WebGLRenderingContext -> createBuffer[func]');
return v_new(WebGLBuffer)
......@@ -191,12 +191,10 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
class WebGLDebugRendererInfo {
get UNMASKED_VENDOR_WEBGL() {
self._toggle[37445] = 1;
return 37445
}
get UNMASKED_RENDERER_WEBGL() {
self._toggle[37446] = 1;
return 37446
}
}
......@@ -227,7 +225,7 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
}
this.getParameter = function (key) {
v_console_log(' [*] WebGLRenderingContext -> getParameter[func]:', key)
this._toggle = {
let _toggle = {
3413: 8,
3412: 8,
3411: 8,
......@@ -252,8 +250,8 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
37446: null,
34047: null
}
if (this._toggle[key]) {
return this._toggle[key]
if (_toggle[key]) {
return _toggle[key]
} else {
if (key == 33902) {
......@@ -401,13 +399,14 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
v_saf(this.createBuffer, 'createBuffer')
v_saf(this.createProgram, 'createProgram')
v_saf(this.createShader, 'createShader')
v_saf(this.getSupportedExtensions, 'getSupportedExtensions')
// v_saf(this.getSupportedExtensions, 'getSupportedExtensions')
v_saf(this.getExtension, 'getExtension')
v_saf(this.getParameter, 'getParameter')
v_saf(this.getContextAttributes, 'getContextAttributes')
v_saf(this.getShaderPrecisionFormat, 'getShaderPrecisionFormat')
})
Object.defineProperties(WebGLRenderingContext.prototype, {
getSupportedExtensions: {value: WebGLRenderingContext.getSupportedExtensions, writable:true, configurable:true, enumerable: true},
DEPTH_BUFFER_BIT: {"value": 256, "writable": false, "enumerable": true, "configurable": false},
STENCIL_BUFFER_BIT: {"value": 1024, "writable": false, "enumerable": true, "configurable": false},
COLOR_BUFFER_BIT: {"value": 16384, "writable": false, "enumerable": true, "configurable": false},
......@@ -1086,10 +1085,12 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
configurable: true
},
})
// let t = proxy(new WebGLRenderingContext, 'WebGLRenderingContext11')
let t = new WebGLRenderingContext()
return t
let t = proxy(new WebGLRenderingContext(), 'WebGLRenderingContext11')
// let t = new WebGLRenderingContext()
this._context = t;
}
// console.log('contextId res', this._context)
return this._context;
}
......@@ -1113,7 +1114,7 @@ class HTMLCanvasElementImpl extends HTMLElementImpl {
let color = Math.floor(Math.random() * 150);
ctx.fillStyle = "rgba(" + color + "," + color + "," + color + ",1)";
ctx.fillRect(randInt(0, this.width), randInt(0, this.height), 3, 3)
ctx.fillRect(randInt(0, this.width), randInt(0, this.height), 1, 1)
}
}
......
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