Prevent detection of wrapped functions (e.g. in WebGL interception) on Chromium.
This commit is contained in:
parent
1d90c874f9
commit
3e501cd0c1
|
@ -6,11 +6,12 @@ function patchWindow(patchingCallback, env = {}) {
|
||||||
// Chromium
|
// Chromium
|
||||||
let exportFunction = (func, targetObject, {defineAs}) => {
|
let exportFunction = (func, targetObject, {defineAs}) => {
|
||||||
let original = targetObject[defineAs];
|
let original = targetObject[defineAs];
|
||||||
if (original && original.toString) {
|
|
||||||
func.toString = original.toString.bind(original);
|
|
||||||
}
|
|
||||||
console.log(`Setting ${targetObject}.${defineAs}`, func);
|
console.log(`Setting ${targetObject}.${defineAs}`, func);
|
||||||
targetObject[defineAs] = func;
|
targetObject[defineAs] = new Proxy(original, {
|
||||||
|
apply(target, thisArg, args) {
|
||||||
|
return func.apply(thisArg, args);
|
||||||
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
let cloneInto = (obj, targetObject) => {
|
let cloneInto = (obj, targetObject) => {
|
||||||
return obj; // dummy for assignment
|
return obj; // dummy for assignment
|
||||||
|
|
Loading…
Reference in New Issue