function hookAJAX() {
XMLHttpRequest.prototype.nativeOpen = XMLHttpRequest.prototype.open;
var customizeOpen = function (method, url, async, user, password) {
this.nativeOpen(method, url, async, user, password);
};
XMLHttpRequest.prototype.open = customizeOpen;
}
function hookImg() {
const property = Object.getOwnPropertyDescriptor(Image.prototype, 'src');
const nativeSet = property.set;
function customiseSrcSet(url) {
nativeSet.call(this, url);
}
Object.defineProperty(Image.prototype, 'src', {
set: customiseSrcSet,
});
}
function hookOpen() {
const nativeOpen = window.open;
window.open = function (url) {
nativeOpen.call(this, url);
};
}
function hookFetch() {
var fet = Object.getOwnPropertyDescriptor(window, 'fetch')
Object.defineProperty(window, 'fetch', {
value: function (a, b, c) {
return fet.value.apply(this, args)
}
})
}