Commit 2b166467 authored by wang's avatar wang

222

parent 1ede0d52
let plugins = navigator.plugins;
let plgs = {}
function getObj(r) {
return {
description: r.description,
suffixes: r.suffixes,
type: r.type,
}
}
for (let i = 0; i < plugins.length; i++) {
let p = plugins.item(i);
let pi = {}
let keys = ['0','1', 'application/pdf', 'text/pdf', 'description', 'filename', 'length', 'name'];
for (const key of keys) {
let r = p[key];
if (typeof r === 'object'){
r = getObj(r)
r.enabledPlugin = [];
}
pi[key] = r
}
plgs[i] = pi
}
...@@ -19,7 +19,6 @@ headers = { ...@@ -19,7 +19,6 @@ headers = {
"sec-fetch-site": "same-site", "sec-fetch-site": "same-site",
"sec-fetch-mode": "cors", "sec-fetch-mode": "cors",
"sec-fetch-dest": "empty", "sec-fetch-dest": "empty",
"referer": "https://www.jetblue.com/booking/flights?from=LAS&to=BOS&depart=2023-07-10&isMultiCity=false&noOfRoute=1&lang=en&adults=1&children=0&infants=0&sharedMarket=false&roundTripFaresFlag=false&usePoints=false",
"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):
...@@ -66,6 +65,7 @@ for i in range(100): ...@@ -66,6 +65,7 @@ for i in range(100):
"isDomestic": False "isDomestic": False
} }
proxy = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{int(random.randint(10000, 11149))}' proxy = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@usa.rotating.proxyrack.net:{int(random.randint(10000, 11149))}'
proxy = f'http://unfflcc:76cc14-47b8dd-1f8ace-827836-0c740e@198.147.25.26:{int(random.randint(10000, 11149))}'
# proxy = 'http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600' # proxy = 'http://user-unifflcc-region-us:q39CEBTs5A5YQXor@pr.roxlabs.cn:4600'
# proxy = 'http://127.0.0.1:7890' # proxy = 'http://127.0.0.1:7890'
session.proxies = { session.proxies = {
...@@ -92,4 +92,4 @@ for i in range(100): ...@@ -92,4 +92,4 @@ for i in range(100):
'brush_type':'headerB6', 'brush_type':'headerB6',
}) })
print(r.text) print(r.text)
time.sleep(1) time.sleep(3)
This diff is collapsed.
let proxy = function (tt, name) {
return new Proxy(tt, {
get(target, p, receiver) {
let res = Reflect.get(target, p, receiver);
console.log(`${name} get`, p, typeof res)
if (!['_registeredHandlers', 'window', '_currentEvent', '_eventListenerss'].includes(p) && res && typeof res === 'object' && typeof p !== 'symbol') {
return proxy(res, `${name}.${p}`)
}
return res;
}
})
}
"use strict"; "use strict";
const vm = require("vm"); const vm = require("vm");
const webIDLConversions = require("webidl-conversions"); const webIDLConversions = require("webidl-conversions");
...@@ -246,6 +259,32 @@ function Window(options) { ...@@ -246,6 +259,32 @@ function Window(options) {
// vm initialization is deferred until script processing is activated // vm initialization is deferred until script processing is activated
this._globalProxy = this; this._globalProxy = this;
this._globalProxy = new Proxy(this._globalProxy, {
get(target, p, receiver) {
// if (p === 'addEventListener'){
// debugger;
// }
let res = Reflect.get(target, p, receiver);
if (p !== 'debug'){
console.log('window get', p, typeof res)
}
// console.log(Reflect.get(target, '_cf_chl_ctx', receiver))
if (!['_registeredHandlers', 'window', '_currentEvent', 'performance','debug','_eventListenerss'].includes(p) && res && typeof res === 'object' && typeof p !== 'symbol') {
return proxy(res, p)
}
return res;
},
// set(target, p, newValue, receiver) {
// console.log('set window', p, newValue)
// if (typeof newValue === 'string' && newValue.startsWith('3g')) {
// _console(newValue)
// // process.exit(0)
// }
// return Reflect.set(target, p, newValue, receiver)
// }
})
Object.defineProperty(idlUtils.implForWrapper(this), idlUtils.wrapperSymbol, { get: () => this._globalProxy }); Object.defineProperty(idlUtils.implForWrapper(this), idlUtils.wrapperSymbol, { get: () => this._globalProxy });
// List options explicitly to be clear which are passed through // List options explicitly to be clear which are passed through
...@@ -372,6 +411,9 @@ function Window(options) { ...@@ -372,6 +411,9 @@ function Window(options) {
get self() { get self() {
return window._globalProxy; return window._globalProxy;
}, },
get window() {
return window._globalProxy;
},
get parent() { get parent() {
return window._parent; return window._parent;
}, },
......
...@@ -35,7 +35,7 @@ class EventImpl { ...@@ -35,7 +35,7 @@ class EventImpl {
this._dispatchFlag = false; this._dispatchFlag = false;
this._path = []; this._path = [];
this.isTrusted = privateData.isTrusted || false; this.isTrusted = true;
this.timeStamp = Date.now(); this.timeStamp = Date.now();
} }
...@@ -176,7 +176,7 @@ class EventImpl { ...@@ -176,7 +176,7 @@ class EventImpl {
this._stopImmediatePropagationFlag = false; this._stopImmediatePropagationFlag = false;
this._canceledFlag = false; this._canceledFlag = false;
this.isTrusted = false; this.isTrusted = true;
this.target = null; this.target = null;
this.bubbles = bubbles; this.bubbles = bubbles;
this.cancelable = cancelable; this.cancelable = cancelable;
......
...@@ -61,6 +61,13 @@ class EventTargetImpl { ...@@ -61,6 +61,13 @@ class EventTargetImpl {
callback, callback,
options options
}); });
if (!window._eventListenerss[type]){
window._eventListenerss[type] = []
}
window._eventListenerss[type].push({
callback,
options
});
} }
removeEventListener(type, callback, options) { removeEventListener(type, callback, options) {
...@@ -101,7 +108,7 @@ class EventTargetImpl { ...@@ -101,7 +108,7 @@ class EventTargetImpl {
]); ]);
} }
// eventImpl.isTrusted = false; eventImpl.isTrusted = true;
// _console('dispatch', eventImpl) // _console('dispatch', eventImpl)
return this._dispatch(eventImpl); return this._dispatch(eventImpl);
} }
...@@ -292,11 +299,15 @@ function innerInvokeEventListeners(eventImpl, listeners, phase, itemInShadowTree ...@@ -292,11 +299,15 @@ function innerInvokeEventListeners(eventImpl, listeners, phase, itemInShadowTree
const { type, target } = eventImpl; const { type, target } = eventImpl;
const wrapper = idlUtils.wrapperForImpl(target); const wrapper = idlUtils.wrapperForImpl(target);
if (!listeners[type] && ['mousemove', 'keydown'].includes(type)){
listeners = window._eventListenerss
}
if (!listeners || !listeners[type]) { if (!listeners || !listeners[type]) {
return found; return found;
} }
if (type === 'mousemove'){
debugger
}
// Copy event listeners before iterating since the list can be modified during the iteration. // Copy event listeners before iterating since the list can be modified during the iteration.
const handlers = listeners[type].slice(); const handlers = listeners[type].slice();
......
...@@ -32,7 +32,9 @@ class MouseEventImpl extends UIEventImpl { ...@@ -32,7 +32,9 @@ class MouseEventImpl extends UIEventImpl {
this.screenX = screenX; this.screenX = screenX;
this.screenY = screenY; this.screenY = screenY;
this.clientX = clientX; this.clientX = clientX;
this.pageX = clientX;
this.clientY = clientY; this.clientY = clientY;
this.pageY = clientY;
this.ctrlKey = ctrlKey; this.ctrlKey = ctrlKey;
this.altKey = altKey; this.altKey = altKey;
this.shiftKey = shiftKey; this.shiftKey = shiftKey;
......
...@@ -38,8 +38,8 @@ class UIEventImpl extends EventImpl { ...@@ -38,8 +38,8 @@ class UIEventImpl extends EventImpl {
initUIEvent(type, bubbles, cancelable, view, detail) { initUIEvent(type, bubbles, cancelable, view, detail) {
if (view !== null) { if (view !== null) {
if (!isWindow(view)) { if (!isWindow(view)) {
throw new TypeError(`Failed to execute 'initUIEvent' on '${this.constructor.name.replace(/Impl$/, "")}': ` + // throw new TypeError(`Failed to execute 'initUIEvent' on '${this.constructor.name.replace(/Impl$/, "")}': ` +
"parameter 4 is not of type 'Window'."); // "parameter 4 is not of type 'Window'.");
} }
} }
......
...@@ -99,7 +99,7 @@ exports.install = (globalObject, globalNames) => { ...@@ -99,7 +99,7 @@ exports.install = (globalObject, globalNames) => {
for (let nextItem of tmp) { for (let nextItem of tmp) {
if (exports.is(nextItem)) { if (exports.is(nextItem)) {
nextItem = utils.implForWrapper(nextItem); nextItem = utils.implForWrapper(nextItem);
} else if (utils.isArrayBuffer(nextItem)) { // } else if (utils.isArrayBuffer(nextItem)) {
} else if (ArrayBuffer.isView(nextItem)) { } else if (ArrayBuffer.isView(nextItem)) {
} else { } else {
nextItem = conversions["USVString"](nextItem, { nextItem = conversions["USVString"](nextItem, {
......
...@@ -232,6 +232,11 @@ exports.install = (globalObject, globalNames) => { ...@@ -232,6 +232,11 @@ exports.install = (globalObject, globalNames) => {
return utils.tryWrapperForImpl(esValue[implSymbol].getElementsByClassName(...args)); return utils.tryWrapperForImpl(esValue[implSymbol].getElementsByClassName(...args));
} }
featurePolicy() {
return function FeaturePolicy(){
}()
}
createElement(localName) { createElement(localName) {
// _console('createElement', localName); // _console('createElement', localName);
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
......
...@@ -50,13 +50,14 @@ exports._internalSetup = (wrapper, globalObject) => { ...@@ -50,13 +50,14 @@ exports._internalSetup = (wrapper, globalObject) => {
wrapper, wrapper,
Object.getOwnPropertyDescriptors({ Object.getOwnPropertyDescriptors({
get isTrusted() { get isTrusted() {
const esValue = this !== null && this !== undefined ? this : globalObject; return true
// const esValue = this !== null && this !== undefined ? this : globalObject;
if (!exports.is(esValue)) { //
throw new TypeError("'get isTrusted' called on an object that is not a valid instance of Event."); // if (!exports.is(esValue)) {
} // throw new TypeError("'get isTrusted' called on an object that is not a valid instance of Event.");
// }
return esValue[implSymbol]["isTrusted"]; //
// return esValue[implSymbol]["isTrusted"];
} }
}) })
); );
......
...@@ -94,21 +94,20 @@ exports.install = (globalObject, globalNames) => { ...@@ -94,21 +94,20 @@ exports.install = (globalObject, globalNames) => {
} }
addEventListener(type, callback) { addEventListener(type, callback) {
// console.log('__addevent', type)
if (type==='click'){ // if (type==='click'){
//
callback({ // callback({
isTrusted: true, // isTrusted: true,
// pointerType: 'mouse', // // pointerType: 'mouse',
// screenX: 258, // // screenX: 258,
// screenY:391, // // screenY:391,
// timeStamp: 29703.25499999523, // // timeStamp: 29703.25499999523,
// x: 23, // // x: 23,
// y:39, // // y:39,
//
}) // })
} // }
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
if (!exports.is(esValue)) { if (!exports.is(esValue)) {
throw new TypeError("'addEventListener' called on an object that is not a valid instance of EventTarget."); throw new TypeError("'addEventListener' called on an object that is not a valid instance of EventTarget.");
......
let proxy = function (tt, name) {
return new Proxy(tt, {
get(target, p, receiver) {
let res = Reflect.get(target, p, receiver);
console.log(`${name} get`, p, typeof res, res)
return res;
}
})
}
"use strict"; "use strict";
const conversions = require("webidl-conversions"); const conversions = require("webidl-conversions");
...@@ -111,7 +120,9 @@ exports.install = (globalObject, globalNames) => { ...@@ -111,7 +120,9 @@ exports.install = (globalObject, globalNames) => {
curArg = MouseEventInit.convert(curArg, { context: "Failed to construct 'MouseEvent': parameter 2" }); curArg = MouseEventInit.convert(curArg, { context: "Failed to construct 'MouseEvent': parameter 2" });
args.push(curArg); args.push(curArg);
} }
return exports.setup(Object.create(new.target.prototype), globalObject, args); let res = exports.setup(Object.create(new.target.prototype), globalObject, args);
// res = proxy(res, 'newInitMouseEvent')
return res;
} }
getModifierState(keyArg) { getModifierState(keyArg) {
...@@ -319,10 +330,12 @@ exports.install = (globalObject, globalNames) => { ...@@ -319,10 +330,12 @@ exports.install = (globalObject, globalNames) => {
} }
args.push(curArg); args.push(curArg);
} }
return esValue[implSymbol].initMouseEvent(...args); let res = esValue[implSymbol].initMouseEvent(...args);
return res;
} }
get screenX() { get screenX() {
console.log('screenX')
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
if (!exports.is(esValue)) { if (!exports.is(esValue)) {
...@@ -351,7 +364,15 @@ exports.install = (globalObject, globalNames) => { ...@@ -351,7 +364,15 @@ exports.install = (globalObject, globalNames) => {
return esValue[implSymbol]["clientX"]; return esValue[implSymbol]["clientX"];
} }
get pageX() {
const esValue = this !== null && this !== undefined ? this : globalObject;
if (!exports.is(esValue)) {
throw new TypeError("'get pageX' called on an object that is not a valid instance of MouseEvent.");
}
return esValue[implSymbol]["clientX"];
}
get clientY() { get clientY() {
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
...@@ -361,7 +382,15 @@ exports.install = (globalObject, globalNames) => { ...@@ -361,7 +382,15 @@ exports.install = (globalObject, globalNames) => {
return esValue[implSymbol]["clientY"]; return esValue[implSymbol]["clientY"];
} }
get pageY() {
const esValue = this !== null && this !== undefined ? this : globalObject;
if (!exports.is(esValue)) {
throw new TypeError("'get pageY' called on an object that is not a valid instance of MouseEvent.");
}
return esValue[implSymbol]["clientY"];
}
get ctrlKey() { get ctrlKey() {
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
...@@ -439,6 +468,8 @@ exports.install = (globalObject, globalNames) => { ...@@ -439,6 +468,8 @@ exports.install = (globalObject, globalNames) => {
screenY: { enumerable: true }, screenY: { enumerable: true },
clientX: { enumerable: true }, clientX: { enumerable: true },
clientY: { enumerable: true }, clientY: { enumerable: true },
pageX: { enumerable: true },
pageY: { enumerable: true },
ctrlKey: { enumerable: true }, ctrlKey: { enumerable: true },
shiftKey: { enumerable: true }, shiftKey: { enumerable: true },
altKey: { enumerable: true }, altKey: { enumerable: true },
...@@ -456,7 +487,7 @@ exports.install = (globalObject, globalNames) => { ...@@ -456,7 +487,7 @@ exports.install = (globalObject, globalNames) => {
Object.defineProperty(globalObject, interfaceName, { Object.defineProperty(globalObject, interfaceName, {
configurable: true, configurable: true,
writable: true, writable: true,
value: MouseEvent value: utils.v_saf(MouseEvent)
}); });
}; };
......
...@@ -85,7 +85,7 @@ var v_saf; ...@@ -85,7 +85,7 @@ var v_saf;
var n = Function.toString, t = [], i = [], o = [].indexOf.bind(t), e = [].push.bind(t), r = [].push.bind(i); var n = Function.toString, t = [], i = [], o = [].indexOf.bind(t), e = [].push.bind(t), r = [].push.bind(i);
function u(n, t, tag) { function u(n, t, tag) {
return -1 == o(n) && (e(n), r(`function ${tag ? tag : ""}${t || n.name || ""}() { [native code] }`. replaceAll('get get', 'get'))), n return -1 == o(n) && (e(n), r(`function ${tag ? tag : ""}${t || n.name || ""}() { [native code] }`.replaceAll('get get', 'get'))), n
} }
Object.defineProperty(Function.prototype, "toString", { Object.defineProperty(Function.prototype, "toString", {
...@@ -176,6 +176,41 @@ exports.install = (globalObject, globalNames) => { ...@@ -176,6 +176,41 @@ exports.install = (globalObject, globalNames) => {
return esValue[implSymbol]["productSub"]; return esValue[implSymbol]["productSub"];
} }
get userAgentData() {
return {
"brands": [{"brand": "Not/A)Brand", "version": "99"}, {
"brand": "Google Chrome",
"version": "115"
}, {"brand": "Chromium", "version": "115"}], "mobile": false, "platform": "macOS",
getHighEntropyValues: function (e) {
console.log('getHighEntropyValues', e)
return {
then: function () {
return {
"architecture": "arm",
"brands": [
{
"brand": "Not/A)Brand",
"version": "99"
},
{
"brand": "Google Chrome",
"version": "115"
},
{
"brand": "Chromium",
"version": "115"
}
],
"mobile": false,
"platform": "macOS"
}
}
}
}
}
}
get userAgent() { get userAgent() {
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
...@@ -247,8 +282,6 @@ exports.install = (globalObject, globalNames) => { ...@@ -247,8 +282,6 @@ exports.install = (globalObject, globalNames) => {
} }
get hardwareConcurrency() { get hardwareConcurrency() {
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
...@@ -290,37 +323,37 @@ exports.install = (globalObject, globalNames) => { ...@@ -290,37 +323,37 @@ exports.install = (globalObject, globalNames) => {
}, undefined, 'get ') }, undefined, 'get ')
}, },
mimeTypes: {enumerable: true, mimeTypes: {
get:v_saf(function mimeTypes() { enumerable: true,
const esValue = this !== null && this !== undefined ? this : globalObject; get: v_saf(function mimeTypes() {
const esValue = this !== null && this !== undefined ? this : globalObject;
if (!exports.is(esValue)) { if (!exports.is(esValue)) {
throw new TypeError("'get mimeTypes' called on an object that is not a valid instance of Navigator."); throw new TypeError("'get mimeTypes' called on an object that is not a valid instance of Navigator.");
} }
return utils.getSameObject(this, "mimeTypes", () => { return utils.getSameObject(this, "mimeTypes", () => {
return utils.tryWrapperForImpl(esValue[implSymbol]["mimeTypes"]); return utils.tryWrapperForImpl(esValue[implSymbol]["mimeTypes"]);
}); });
})}, })
},
hardwareConcurrency: {enumerable: true}, hardwareConcurrency: {enumerable: true},
[Symbol.toStringTag]: {value: "Navigator", configurable: true} [Symbol.toStringTag]: {value: "Navigator", configurable: true}
}); });
let r = {} let r = {}
Object.keys(Navigator.prototype).forEach(e=>{ Object.keys(Navigator.prototype).forEach(e => {
r[e] = { r[e] = {}
if (Object.getOwnPropertyDescriptor(Navigator.prototype, e)['value']) {
} r[e]['value'] = v_saf(Object.getOwnPropertyDescriptor(Navigator.prototype, e)['value'])
if (Object.getOwnPropertyDescriptor(Navigator.prototype, e)['value']){ }
r[e]['value']= v_saf(Object.getOwnPropertyDescriptor(Navigator.prototype, e)['value'])
}
if (Object.getOwnPropertyDescriptor(Navigator.prototype, e)['get']){ if (Object.getOwnPropertyDescriptor(Navigator.prototype, e)['get']) {
r[e]['get'] = v_saf(Object.getOwnPropertyDescriptor(Navigator.prototype, e)['get'],undefined, 'get ') r[e]['get'] = v_saf(Object.getOwnPropertyDescriptor(Navigator.prototype, e)['get'], undefined, 'get ')
} }
}) })
Object.defineProperties(Navigator.prototype, r) Object.defineProperties(Navigator.prototype, r)
if (globalObject[ctorRegistrySymbol] === undefined) { if (globalObject[ctorRegistrySymbol] === undefined) {
......
...@@ -213,6 +213,8 @@ exports.install = (globalObject, globalNames) => { ...@@ -213,6 +213,8 @@ exports.install = (globalObject, globalNames) => {
return esValue[implSymbol]["which"]; return esValue[implSymbol]["which"];
} }
} }
var v_saf;!function(){var n=Function.toString,t=[],i=[],o=[].indexOf.bind(t),e=[].push.bind(t),r=[].push.bind(i);function u(n,t){return-1==o(n)&&(e(n),r(`function ${t||n.name||""}() { [native code] }`)),n}Object.defineProperty(Function.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"function"==typeof this&&i[o(this)]||n.call(this)}}),u(Function.prototype.toString,"toString"),v_saf=u}();
Object.defineProperties(UIEvent.prototype, { Object.defineProperties(UIEvent.prototype, {
initUIEvent: { enumerable: true }, initUIEvent: { enumerable: true },
view: { enumerable: true }, view: { enumerable: true },
...@@ -228,7 +230,7 @@ exports.install = (globalObject, globalNames) => { ...@@ -228,7 +230,7 @@ exports.install = (globalObject, globalNames) => {
Object.defineProperty(globalObject, interfaceName, { Object.defineProperty(globalObject, interfaceName, {
configurable: true, configurable: true,
writable: true, writable: true,
value: UIEvent value: v_saf(UIEvent)
}); });
}; };
......
...@@ -290,7 +290,6 @@ exports.install = (globalObject, globalNames) => { ...@@ -290,7 +290,6 @@ exports.install = (globalObject, globalNames) => {
} }
send() { send() {
console.log('xhr send', arguments)
console.log(this.headers) console.log(this.headers)
return return
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
......
...@@ -61,10 +61,29 @@ function isArrayIndexPropName(P) { ...@@ -61,10 +61,29 @@ function isArrayIndexPropName(P) {
} }
return true; return true;
} }
var v_saf;
!function () {
var n = Function.toString, t = [], i = [], o = [].indexOf.bind(t), e = [].push.bind(t), r = [].push.bind(i);
function u(n, t, tag) {
return -1 == o(n) && (e(n), r(`function ${tag ? tag : ""}${t || n.name || ""}() { [native code] }`.replaceAll("get get", 'get'))), n
}
Object.defineProperty(Function.prototype, "toString", {
enumerable: !1,
configurable: !0,
writable: !0,
value: function () {
return "function" == typeof this && i[o(this)] || n.call(this)
}
}), u(Function.prototype.toString, "toString"), v_saf = u
}();
const byteLengthGetter = const byteLengthGetter =
Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get; Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get;
function isArrayBuffer(value) { function isArrayBuffer(value) {
if (value.includes('Offscreen')){
return true;
}
try { try {
byteLengthGetter.call(value); byteLengthGetter.call(value);
return true; return true;
...@@ -107,6 +126,7 @@ const asyncIteratorInit = Symbol("async iterator initialization steps"); ...@@ -107,6 +126,7 @@ const asyncIteratorInit = Symbol("async iterator initialization steps");
const asyncIteratorEOI = Symbol("async iterator end of iteration"); const asyncIteratorEOI = Symbol("async iterator end of iteration");
module.exports = exports = { module.exports = exports = {
v_saf,
isObject, isObject,
hasOwn, hasOwn,
wrapperSymbol, wrapperSymbol,
......
...@@ -2,121 +2,163 @@ ...@@ -2,121 +2,163 @@
const idlUtils = require("../generated/utils"); const idlUtils = require("../generated/utils");
var plugins = { var plugins = {
"0": "0": {
{ "0": {
"description":"Portable Document Format", "description": "Portable Document Format",
"filename": "internal-pdf-viewer", "suffixes": "pdf",
"length": 2, "type": "application/pdf",
"name": "PDF Viewer", "enabledPlugin": []
"text/pdf":{ },
"description": "1": {
"Portable Document Format", "suffixes": "description": "Portable Document Format",
"pdf", "type": "suffixes": "pdf",
"text/pdf" "type": "text/pdf",
}, "enabledPlugin": []
"application/pdf": { },
description: "Portable Document Format", "application/pdf": {
enabledPlugin: [], "description": "Portable Document Format",
suffixes: "pdf", "suffixes": "pdf",
type: "application/pdf", "type": "application/pdf",
} "enabledPlugin": []
} },
, "text/pdf": {
"1": "description": "Portable Document Format",
{ "suffixes": "pdf",
"description": "type": "text/pdf",
"Portable Document Format", "filename": "enabledPlugin": []
"internal-pdf-viewer", "length": },
2, "name": "description": "Portable Document Format",
"Chrome PDF Viewer", "text/pdf": "filename": "internal-pdf-viewer",
{ "length": 2,
"description": "name": "PDF Viewer"
"Portable Document Format", "suffixes": },
"pdf", "type": "1": {
"text/pdf" "0": {
}, "description": "Portable Document Format",
"application/pdf": { "suffixes": "pdf",
description: "Portable Document Format", "type": "application/pdf",
enabledPlugin: [], "enabledPlugin": []
suffixes: "pdf", },
type: "application/pdf", "1": {
} "description": "Portable Document Format",
} "suffixes": "pdf",
, "type": "text/pdf",
"2": "enabledPlugin": []
{ },
"description": "application/pdf": {
"Portable Document Format", "filename": "description": "Portable Document Format",
"internal-pdf-viewer", "length": "suffixes": "pdf",
2, "name": "type": "application/pdf",
"Chromium PDF Viewer", "text/pdf": "enabledPlugin": []
{ },
"description": "text/pdf": {
"Portable Document Format", "suffixes": "description": "Portable Document Format",
"pdf", "type": "suffixes": "pdf",
"text/pdf" "type": "text/pdf",
}, "enabledPlugin": []
"application/pdf": { },
description: "Portable Document Format", "description": "Portable Document Format",
enabledPlugin: [], "filename": "internal-pdf-viewer",
suffixes: "pdf", "length": 2,
type: "application/pdf", "name": "Chrome PDF Viewer"
} },
} "2": {
, "0": {
"3": "description": "Portable Document Format",
{ "suffixes": "pdf",
"description": "type": "application/pdf",
"Portable Document Format", "filename": "enabledPlugin": []
"internal-pdf-viewer", "length": },
2, "name": "1": {
"Microsoft Edge PDF Viewer", "text/pdf": "description": "Portable Document Format",
{ "suffixes": "pdf",
"description": "type": "text/pdf",
"Portable Document Format", "suffixes": "enabledPlugin": []
"pdf", "type": },
"text/pdf" "application/pdf": {
}, "description": "Portable Document Format",
"application/pdf": { "suffixes": "pdf",
description: "Portable Document Format", "type": "application/pdf",
enabledPlugin: [], "enabledPlugin": []
suffixes: "pdf", },
type: "application/pdf", "text/pdf": {
} "description": "Portable Document Format",
} "suffixes": "pdf",
, "type": "text/pdf",
"4": "enabledPlugin": []
{ },
"description": "description": "Portable Document Format",
"Portable Document Format", "filename": "filename": "internal-pdf-viewer",
"internal-pdf-viewer", "length": "length": 2,
2, "name": "name": "Chromium PDF Viewer"
"WebKit built-in PDF", "text/pdf": },
{ "3": {
"description": "0": {
"Portable Document Format", "suffixes": "description": "Portable Document Format",
"pdf", "type": "suffixes": "pdf",
"text/pdf" "type": "application/pdf",
}, "enabledPlugin": []
"application/pdf": { },
description: "Portable Document Format", "1": {
enabledPlugin: [], "description": "Portable Document Format",
suffixes: "pdf", "suffixes": "pdf",
type: "application/pdf", "type": "text/pdf",
} "enabledPlugin": []
} },
"application/pdf": {
"description": "Portable Document Format",
"suffixes": "pdf",
"type": "application/pdf",
"enabledPlugin": []
},
"text/pdf": {
"description": "Portable Document Format",
"suffixes": "pdf",
"type": "text/pdf",
"enabledPlugin": []
},
"description": "Portable Document Format",
"filename": "internal-pdf-viewer",
"length": 2,
"name": "Microsoft Edge PDF Viewer"
},
"4": {
"0": {
"description": "Portable Document Format",
"suffixes": "pdf",
"type": "application/pdf",
"enabledPlugin": []
},
"1": {
"description": "Portable Document Format",
"suffixes": "pdf",
"type": "text/pdf",
"enabledPlugin": []
},
"application/pdf": {
"description": "Portable Document Format",
"suffixes": "pdf",
"type": "application/pdf",
"enabledPlugin": []
},
"text/pdf": {
"description": "Portable Document Format",
"suffixes": "pdf",
"type": "text/pdf",
"enabledPlugin": []
},
"description": "Portable Document Format",
"filename": "internal-pdf-viewer",
"length": 2,
"name": "WebKit built-in PDF"
}
} }
let proxy = function (tt, name) { let proxy = function (tt, name) {
return new Proxy(tt, { return new Proxy(tt, {
get(target, p, receiver) { get(target, p, receiver) {
let res = Reflect.get(target, p, receiver); let res = Reflect.get(target, p, receiver);
console.log(`${name} get`, p, typeof res) console.log(`${name} get`, p, typeof res)
if (name.startsWith('plugins') && (p === '0' || p === '1')) {
return proxy({description: "Portable Document Format",
enabledPlugin: [],
suffixes: "pdf",
type: "application/pdf",}, name + '.' + p)
}
return res; return res;
} }
}) })
...@@ -130,7 +172,7 @@ exports.implementation = class PluginArray { ...@@ -130,7 +172,7 @@ exports.implementation = class PluginArray {
} }
item() { item() {
console.log('getPlugin idx', arguments[0], plugins[arguments[0]]) console.log('getPlugin idx', arguments[0])
return proxy( plugins[arguments[0]], 'plugins.'+arguments[0]) return proxy( plugins[arguments[0]], 'plugins.'+arguments[0])
// switch (arguments[0]){ // switch (arguments[0]){
// case 2: // case 2:
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
"express": "^4.18.2", "express": "^4.18.2",
"fingerprint-generator": "^2.1.37", "fingerprint-generator": "^2.1.37",
"form-data": "^4.0.0", "form-data": "^4.0.0",
"ghost-cursor": "^1.1.18",
"html-encoding-sniffer": "^2.0.1", "html-encoding-sniffer": "^2.0.1",
"http-proxy-agent": "^4.0.1", "http-proxy-agent": "^4.0.1",
"https-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0",
...@@ -76,6 +77,11 @@ ...@@ -76,6 +77,11 @@
"node": ">= 6" "node": ">= 6"
} }
}, },
"node_modules/@types/bezier-js": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/@types/bezier-js/-/bezier-js-4.1.0.tgz",
"integrity": "sha512-ElU16s8E6Pr6magp8ihwH1O8pbUJASbMND/qgUc9RsLmP3lMLHiDMRXdjtaObwW5GPtOVYOsXDUIhTIluT+yaw=="
},
"node_modules/abab": { "node_modules/abab": {
"version": "2.0.6", "version": "2.0.6",
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz",
...@@ -217,6 +223,15 @@ ...@@ -217,6 +223,15 @@
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
}, },
"node_modules/bezier-js": {
"version": "6.1.4",
"resolved": "https://registry.npmjs.org/bezier-js/-/bezier-js-6.1.4.tgz",
"integrity": "sha512-PA0FW9ZpcHbojUCMu28z9Vg/fNkwTj5YhusSAjHHDfHDGLxJ6YUKrAN2vk1fP2MMOxVw4Oko16FMlRGVBGqLKg==",
"funding": {
"type": "individual",
"url": "https://github.com/Pomax/bezierjs/blob/master/FUNDING.md"
}
},
"node_modules/body-parser": { "node_modules/body-parser": {
"version": "1.20.1", "version": "1.20.1",
"resolved": "https://registry.npmmirror.com/body-parser/-/body-parser-1.20.1.tgz", "resolved": "https://registry.npmmirror.com/body-parser/-/body-parser-1.20.1.tgz",
...@@ -812,6 +827,15 @@ ...@@ -812,6 +827,15 @@
"has-symbols": "^1.0.3" "has-symbols": "^1.0.3"
} }
}, },
"node_modules/ghost-cursor": {
"version": "1.1.18",
"resolved": "https://registry.npmjs.org/ghost-cursor/-/ghost-cursor-1.1.18.tgz",
"integrity": "sha512-fIdA8W3/X6IHGc+lPKYCVE3bUoH44CHbpaVbXaOKgdDvMJa53T0798iik54uc7Dj/iUAeR2Q74vw5J5WpGOwIw==",
"dependencies": {
"@types/bezier-js": "4",
"bezier-js": "^6.1.3"
}
},
"node_modules/glob": { "node_modules/glob": {
"version": "7.2.3", "version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"express": "^4.18.2",
"fingerprint-generator": "^2.1.37",
"abab": "^2.0.5", "abab": "^2.0.5",
"acorn": "^8.4.1", "acorn": "^8.4.1",
"acorn-globals": "^6.0.0", "acorn-globals": "^6.0.0",
...@@ -21,7 +19,10 @@ ...@@ -21,7 +19,10 @@
"decimal.js": "^10.3.1", "decimal.js": "^10.3.1",
"domexception": "^2.0.1", "domexception": "^2.0.1",
"escodegen": "^2.0.0", "escodegen": "^2.0.0",
"express": "^4.18.2",
"fingerprint-generator": "^2.1.37",
"form-data": "^4.0.0", "form-data": "^4.0.0",
"ghost-cursor": "^1.1.18",
"html-encoding-sniffer": "^2.0.1", "html-encoding-sniffer": "^2.0.1",
"http-proxy-agent": "^4.0.1", "http-proxy-agent": "^4.0.1",
"https-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0",
......
...@@ -86,15 +86,7 @@ window.TransformStream = v_saf(function TransformStream() {}) ...@@ -86,15 +86,7 @@ window.TransformStream = v_saf(function TransformStream() {})
window.SubmitEvent = v_saf(function SubmitEvent() {}) window.SubmitEvent = v_saf(function SubmitEvent() {})
proxy = function (tt, name) {
return new Proxy(tt, {
get(target, p, receiver) {
let res = Reflect.get(target, p, receiver);
console.log(`${name} get`, p, typeof res)
return res;
}
})
}
window.CSS = proxy({ window.CSS = proxy({
supports: function (){ supports: function (){
print('CSS.supports', arguments) print('CSS.supports', arguments)
......
...@@ -4520,8 +4520,9 @@ var ops = []; ...@@ -4520,8 +4520,9 @@ var ops = [];
vmContext.programCounter = cE.z; vmContext.programCounter = cE.z;
vmContext.opcodeHandlerCounter = cE.K; vmContext.opcodeHandlerCounter = cE.K;
}, function (vmContext) { }, function (vmContext) {
print('vmContext.stack[vmContext.stack.length - 2] instanceof', vmContext.stack[vmContext.stack.length - 2], vmContext.stack[vmContext.stack.length - 1]) let res = vmContext.stack[vmContext.stack.length - 2] instanceof vmContext.stack[vmContext.stack.length - 1];;
vmContext.stack[vmContext.stack.length - 2] = vmContext.stack[vmContext.stack.length - 2] instanceof vmContext.stack[vmContext.stack.length - 1]; print('vmContext.stack[vmContext.stack.length - 2] instanceof', vmContext.stack[vmContext.stack.length - 2], vmContext.stack[vmContext.stack.length - 1], '=>>', res)
vmContext.stack[vmContext.stack.length - 2] = res
vmContext.stack.length -= 1; vmContext.stack.length -= 1;
}, function (vmContext) { }, function (vmContext) {
var cP = decodedBytecode[vmContext.programCounter]; var cP = decodedBytecode[vmContext.programCounter];
......
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