1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-03-13 11:44:12 +01:00

Only interfecpt constructors that are present.

Fixes #108.
This commit is contained in:
kkapsner 2017-02-22 17:46:17 +01:00
parent a8611230b1
commit f85303065c

View File

@ -41,10 +41,12 @@
var changedFunction = changedFunctions[name];
if (changedFunction.getStatus(undefined, siteStatus).active){
(Array.isArray(changedFunction.object)? changedFunction.object: [changedFunction.object]).forEach(function(object){
var original = window.wrappedJSObject[object].prototype[name];
var constructor = window.wrappedJSObject[object];
if (constructor){
var original = constructor.prototype[name];
Object.defineProperty(
window.wrappedJSObject[object].prototype,
constructor.prototype,
name,
{
enumerable: true,
@ -91,6 +93,7 @@
}
}
);
}
});
}
});