I'm using shim that modifies several of the properties in the browsers window object.
At this point I need to validate if one of the specific properties is native or a shim. Because shim can modify the native property.
For example:
(function () {
var native = window.alert;
window.alert = function (): {
/* faz alguma coisa */
console.log(arguments);
return native.apply(this, arguments);
};
})();
In the example we can see that it does not change the functionality of alert
by applying the original to the end, however this alert
is no longer the original in another code snippet I would like to know if this method is the original or a modified.
% w / w was used only as an example of the problem.
Without modifying the "shim" that no longer exposes the alert
native, how to access the alert
native to compare with the modified and know that the function in alert
is not native?