Commit e7324d0c authored by wang's avatar wang

适配不同版本 chrome

parent 64d71ee9
...@@ -112,7 +112,7 @@ let a = 0.08636862211354912 * 4294967296 ...@@ -112,7 +112,7 @@ let a = 0.08636862211354912 * 4294967296
let bl_2 = a >>> 0 let bl_2 = a >>> 0
// cbb_63 = window["performance"]["now"](); // cbb_63 = window["performance"]["now"]();
// var bl_1 = cbb_63 >>> 0; // var bl_1 = cbb_63 >>> 0;
let a1 = 1181 let a1 = 8580
let bl_1 = a1 >>>0; let bl_1 = a1 >>>0;
// var bl_3 = Number(new window["Date"]()) >>> 0; // var bl_3 = Number(new window["Date"]()) >>> 0;
let bl_3 = 1693903208580 >>> 0; let bl_3 = 1693903208580 >>> 0;
...@@ -122,7 +122,10 @@ let bl_0 = 2389837486; ...@@ -122,7 +122,10 @@ let bl_0 = 2389837486;
console.log(bl_2, bl_1, bl_3) console.log(bl_2, bl_1, bl_3)
bl_0 = bl_0 + bl_2 + bl_1 bl_0 = bl_0 + bl_2 + bl_1
bl_2 = bl_3 bl_2 = bl_3
console.log(bl_0) console.log('bl_2', bl_2 )
console.log('bl_0', bl_0 )
console.log(bl_0 + bl_3 )
console.log((bl_0 + bl_3 ) >>> 0)
bl_0 = bl_0 + bl_3 +bl_4 bl_0 = bl_0 + bl_3 +bl_4
console.log(bl_0 >>> 0) console.log(bl_0 >>> 0)
...@@ -872,7 +872,7 @@ try { ...@@ -872,7 +872,7 @@ try {
navigator.userAgentData && navigator.userAgentData.getHighEntropyValues(['architecture', 'bitness', 'brands', 'mobile', 'model', 'platform', navigator.userAgentData && navigator.userAgentData.getHighEntropyValues(['architecture', 'bitness', 'brands', 'mobile', 'model', 'platform',
'platformVersion', 'uaFullVersion', 'wow64', 'fullVersionList']).then(e => { 'platformVersion', 'uaFullVersion', 'wow64', 'fullVersionList']).then(e => {
userAgentData['highValue'] = e userAgentData['highvalue'] = e
userAgentData['brands'] = navigator.userAgentData.brands userAgentData['brands'] = navigator.userAgentData.brands
userAgentData['mobile'] = navigator.userAgentData.mobile userAgentData['mobile'] = navigator.userAgentData.mobile
userAgentData['platform'] = navigator.userAgentData.platform userAgentData['platform'] = navigator.userAgentData.platform
......
...@@ -91,9 +91,9 @@ for i in range(100): ...@@ -91,9 +91,9 @@ 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, '11'], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
# p = subprocess.Popen(['node', 'src_run_chrome_105.js', selectId, '11'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, # p = subprocess.Popen(['node', 'src_run_chrome_105.js', selectId, '11'], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
p = subprocess.Popen(['node', 'src_run_company_chrome.js', selectId, '11'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, # p = subprocess.Popen(['node', 'src_run_company_chrome.js', selectId, '11'], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
# p = subprocess.Popen(['node', 'src_run.js', selectId, '11'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, # p = subprocess.Popen(['node', 'src_run.js', selectId, '11'], stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE) stderr=subprocess.PIPE)
......
This diff is collapsed.
...@@ -289,11 +289,6 @@ ...@@ -289,11 +289,6 @@
"enumerable": false, "enumerable": false,
"configurable": true "configurable": true
}, },
"SharedArrayBuffer": {
"writable": true,
"enumerable": false,
"configurable": true
},
"Atomics": { "Atomics": {
"writable": true, "writable": true,
"enumerable": false, "enumerable": false,
......
...@@ -4,7 +4,7 @@ var v_saf; ...@@ -4,7 +4,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').replaceAll('set set', 'set'))), n
} }
Object.defineProperty(Function.prototype, "toString", { Object.defineProperty(Function.prototype, "toString", {
...@@ -3417,6 +3417,9 @@ exports.install = (globalObject, globalNames) => { ...@@ -3417,6 +3417,9 @@ exports.install = (globalObject, globalNames) => {
if (Object.getOwnPropertyDescriptor(Document.prototype, e)['get']){ if (Object.getOwnPropertyDescriptor(Document.prototype, e)['get']){
r[e]['get'] = v_saf(Object.getOwnPropertyDescriptor(Document.prototype, e)['get'],undefined, 'get ') r[e]['get'] = v_saf(Object.getOwnPropertyDescriptor(Document.prototype, e)['get'],undefined, 'get ')
} }
if (Object.getOwnPropertyDescriptor(Document.prototype, e)['set']){
r[e]['set'] = v_saf(Object.getOwnPropertyDescriptor(Document.prototype, e)['set'],undefined, 'set ')
}
}) })
Object.defineProperties(Document.prototype, r) Object.defineProperties(Document.prototype, r)
if (globalObject[ctorRegistrySymbol] === undefined) { if (globalObject[ctorRegistrySymbol] === undefined) {
......
...@@ -211,6 +211,7 @@ exports.install = (globalObject, globalNames) => { ...@@ -211,6 +211,7 @@ exports.install = (globalObject, globalNames) => {
} }
get length() { get length() {
return 2
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
if (!exports.is(esValue)) { if (!exports.is(esValue)) {
......
...@@ -48,55 +48,10 @@ exports._internalSetup = (wrapper, globalObject) => { ...@@ -48,55 +48,10 @@ exports._internalSetup = (wrapper, globalObject) => {
Object.defineProperties( Object.defineProperties(
wrapper, wrapper,
Object.getOwnPropertyDescriptors({ Object.getOwnPropertyDescriptors({
assign(url) { get ancestorOrigins() {
const esValue = this !== null && this !== undefined ? this : globalObject; return {
if (!exports.is(esValue)) { length:0
throw new TypeError("'assign' called on an object that is not a valid instance of Location.");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'assign' on 'Location': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["USVString"](curArg, {
context: "Failed to execute 'assign' on 'Location': parameter 1"
});
args.push(curArg);
}
return esValue[implSymbol].assign(...args);
},
replace(url) {
const esValue = this !== null && this !== undefined ? this : globalObject;
if (!exports.is(esValue)) {
throw new TypeError("'replace' called on an object that is not a valid instance of Location.");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'replace' on 'Location': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["USVString"](curArg, {
context: "Failed to execute 'replace' on 'Location': parameter 1"
});
args.push(curArg);
}
return esValue[implSymbol].replace(...args);
},
reload() {
const esValue = this !== null && this !== undefined ? this : globalObject;
if (!exports.is(esValue)) {
throw new TypeError("'reload' called on an object that is not a valid instance of Location.");
} }
return esValue[implSymbol].reload();
}, },
get href() { get href() {
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
...@@ -120,14 +75,6 @@ exports._internalSetup = (wrapper, globalObject) => { ...@@ -120,14 +75,6 @@ exports._internalSetup = (wrapper, globalObject) => {
esValue[implSymbol]["href"] = V; esValue[implSymbol]["href"] = V;
}, },
toString() {
const esValue = this;
if (!exports.is(esValue)) {
throw new TypeError("'toString' called on an object that is not a valid instance of Location.");
}
return esValue[implSymbol]["href"];
},
get origin() { get origin() {
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
...@@ -269,11 +216,7 @@ exports._internalSetup = (wrapper, globalObject) => { ...@@ -269,11 +216,7 @@ exports._internalSetup = (wrapper, globalObject) => {
esValue[implSymbol]["search"] = V; esValue[implSymbol]["search"] = V;
}, },
get ancestorOrigins() {
return {
length:0
}
},
get hash() { get hash() {
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
...@@ -295,7 +238,66 @@ exports._internalSetup = (wrapper, globalObject) => { ...@@ -295,7 +238,66 @@ exports._internalSetup = (wrapper, globalObject) => {
}); });
esValue[implSymbol]["hash"] = V; esValue[implSymbol]["hash"] = V;
} },
assign(url) {
const esValue = this !== null && this !== undefined ? this : globalObject;
if (!exports.is(esValue)) {
throw new TypeError("'assign' called on an object that is not a valid instance of Location.");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'assign' on 'Location': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["USVString"](curArg, {
context: "Failed to execute 'assign' on 'Location': parameter 1"
});
args.push(curArg);
}
return esValue[implSymbol].assign(...args);
},
reload() {
const esValue = this !== null && this !== undefined ? this : globalObject;
if (!exports.is(esValue)) {
throw new TypeError("'reload' called on an object that is not a valid instance of Location.");
}
return esValue[implSymbol].reload();
},
replace(url) {
const esValue = this !== null && this !== undefined ? this : globalObject;
if (!exports.is(esValue)) {
throw new TypeError("'replace' called on an object that is not a valid instance of Location.");
}
if (arguments.length < 1) {
throw new TypeError(
"Failed to execute 'replace' on 'Location': 1 argument required, but only " + arguments.length + " present."
);
}
const args = [];
{
let curArg = arguments[0];
curArg = conversions["USVString"](curArg, {
context: "Failed to execute 'replace' on 'Location': parameter 1"
});
args.push(curArg);
}
return esValue[implSymbol].replace(...args);
},
toString() {
const esValue = this;
if (!exports.is(esValue)) {
throw new TypeError("'toString' called on an object that is not a valid instance of Location.");
}
return esValue[implSymbol]["href"];
},
}) })
); );
......
...@@ -97,6 +97,8 @@ exports.install = (globalObject, globalNames) => { ...@@ -97,6 +97,8 @@ exports.install = (globalObject, globalNames) => {
} }
now() { now() {
return Number('1693903208580'.slice(8))
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("'now' called on an object that is not a valid instance of Performance."); throw new TypeError("'now' called on an object that is not a valid instance of Performance.");
......
...@@ -12,7 +12,7 @@ var v_saf; ...@@ -12,7 +12,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').replaceAll("set set", 'set'))), n
} }
Object.defineProperty(Function.prototype, "toString", { Object.defineProperty(Function.prototype, "toString", {
......
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
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