mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02:00
First proxy attempt
This commit is contained in:
parent
42b19a4ba5
commit
211d6710f6
4 changed files with 46 additions and 17 deletions
|
@ -136,6 +136,16 @@
|
|||
}
|
||||
};
|
||||
|
||||
scope.createProxyFunction = function createProxyFunction(window, original, replacement){
|
||||
const wrappedWindow = scope.getWrapped(window);
|
||||
const handler = wrappedWindow.Object.create(wrappedWindow.Object);
|
||||
handler.apply = scope.exportFunctionWithName(function(target, thisArgs, args){
|
||||
// console.log(target, thisArgs, args);
|
||||
return replacement.apply(thisArgs, args);
|
||||
}, window, "");
|
||||
return new wrappedWindow.Proxy(original, handler);
|
||||
};
|
||||
|
||||
const changedPropertiesByWindow = new WeakMap();
|
||||
scope.changeProperty = function(window, group, {object, name, type, changed}){
|
||||
let changedProperties = changedPropertiesByWindow.get(scope.getWrapped(window));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue