Skip to content

Instantly share code, notes, and snippets.

@alufers
Created July 20, 2023 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alufers/895f6b2fbd37734567bdbf4d3291e1f7 to your computer and use it in GitHub Desktop.
Save alufers/895f6b2fbd37734567bdbf4d3291e1f7 to your computer and use it in GitHub Desktop.
Instrumentator
__buf = "";
__window = {
atob: function (str) {
let d = atob(str);
console.log(__buf)
__buf = "";
return d;
},
String: {
fromCharCode: function (...args) {
let d = String.fromCharCode(...args);
__buf += d;
return d;
}
},
RegExp: RegExp,
JSON: JSON,
Array: Array,
};
window = new Proxy(__window, {
get: function (target, name) {
// console.log('get', name);
return target[name] || __window[name];
},
});
__document = {
addEventListener: function (...args) {
console.log('addEventListener', ...args);
},
};
document = new Proxy(__document, {
get: function (target, name) {
// console.log('get', name);
return target[name] || __document[name];
},
fetch: function (...args) {
console.log('fetch', ...args);
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment