Commit 5ca8f28f authored by wangmingming's avatar wangmingming

333

parent fd388530
This diff is collapsed.
...@@ -3,7 +3,7 @@ let proxy = function (tt, name) { ...@@ -3,7 +3,7 @@ let proxy = function (tt, name) {
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 (!['_registeredHandlers', 'window', '_currentEvent', '_eventListenerss'].includes(p) && res && typeof res === 'object' && typeof p !== 'symbol') { if (!['_registeredHandlers', 'window', '_currentEvent', '_eventListenerss','JSON','Math','JSON'].includes(p) && res && typeof res === 'object' && typeof p !== 'symbol') {
return proxy(res, `${name}.${p}`) return proxy(res, `${name}.${p}`)
} }
return res; return res;
...@@ -274,7 +274,7 @@ function Window(options) { ...@@ -274,7 +274,7 @@ function Window(options) {
// } // }
// console.log(Reflect.get(target, '_cf_chl_ctx', receiver)) // 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') { if (!['_registeredHandlers', 'window', '_currentEvent', 'performance','debug','_eventListenerss','top','JSON', 'Math'].includes(p) && res && typeof res === 'object' && typeof p !== 'symbol') {
return proxy(res, p) return proxy(res, p)
} }
return res; return res;
......
...@@ -274,6 +274,7 @@ exports.install = (globalObject, globalNames) => { ...@@ -274,6 +274,7 @@ exports.install = (globalObject, globalNames) => {
} }
get userAgent() { get userAgent() {
return window.fingerprint.navigator.userAgent;
const esValue = this !== null && this !== undefined ? this : globalObject; const esValue = this !== null && this !== undefined ? this : globalObject;
if (!exports.is(esValue)) { if (!exports.is(esValue)) {
......
This diff is collapsed.
...@@ -13,6 +13,7 @@ class NavigatorImpl { ...@@ -13,6 +13,7 @@ class NavigatorImpl {
constructor(globalObject, args, privateData) { constructor(globalObject, args, privateData) {
this._globalObject = globalObject; this._globalObject = globalObject;
this.userAgent = privateData.userAgent; this.userAgent = privateData.userAgent;
// this.userAgent = window.fingerprint.navigator.userAgent;
this.languages = Object.freeze(["en-US", "en"]); this.languages = Object.freeze(["en-US", "en"]);
this.plugins = PluginArray.create(this._globalObject); this.plugins = PluginArray.create(this._globalObject);
this.mimeTypes = MimeTypeArray.create(this._globalObject); this.mimeTypes = MimeTypeArray.create(this._globalObject);
......
...@@ -2,36 +2,51 @@ ...@@ -2,36 +2,51 @@
exports.implementation = class NavigatorIDImpl { exports.implementation = class NavigatorIDImpl {
get appCodeName() { get appCodeName() {
return window.fingerprint.navigator.appCodeName
return "Mozilla"; return "Mozilla";
} }
get appName() { get appName() {
return window.fingerprint.navigator.appName
return "Netscape"; return "Netscape";
} }
get appVersion() { get appVersion() {
return window.fingerprint.navigator.appVersion
return "4.0"; return "4.0";
} }
get platform() { get platform() {
return window.fingerprint.navigator.platform
return ""; return "";
} }
get product() { get product() {
return window.fingerprint.navigator.product
return "Gecko"; return "Gecko";
} }
get productSub() { get productSub() {
return window.fingerprint.navigator.productSub
return "20030107"; return "20030107";
} }
// see Navigator constructor for userAgent // see Navigator constructor for userAgent
get vendor() { get vendor() {
return window.fingerprint.navigator.vendor
return "Apple Computer, Inc."; return "Apple Computer, Inc.";
} }
get vendorSub() { get vendorSub() {
return window.fingerprint.navigator.vendorSub
return ""; return "";
} }
}; };
...@@ -10,4 +10,11 @@ ScreenImpl.prototype.height = 0; ...@@ -10,4 +10,11 @@ ScreenImpl.prototype.height = 0;
ScreenImpl.prototype.colorDepth = 24; ScreenImpl.prototype.colorDepth = 24;
ScreenImpl.prototype.pixelDepth = 24; ScreenImpl.prototype.pixelDepth = 24;
// ScreenImpl.prototype.availWidth = window.fingerprint.screen.availWidth;
// ScreenImpl.prototype.availHeight = window.fingerprint.screen.availHeight;
// ScreenImpl.prototype.width = window.fingerprint.screen.width;
// ScreenImpl.prototype.height = window.fingerprint.screen.height;
// ScreenImpl.prototype.colorDepth = window.fingerprint.screen.colorDepth;
// ScreenImpl.prototype.pixelDepth = window.fingerprint.screen.pixelDepth;
exports.implementation = ScreenImpl; exports.implementation = ScreenImpl;
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