diff --git a/_locales/de/messages.json b/_locales/de/messages.json index 11dcc92..a7e722a 100644 --- a/_locales/de/messages.json +++ b/_locales/de/messages.json @@ -359,6 +359,10 @@ "description": "" }, + "preBlock": { + "message": "API auf {url} blockiert, weil die CanvasBlocker-Einstellungen nicht rechtzeitig geladen wurden.", + "description": "" + }, "fakedReadout": { "message": "Auslese vorgetäuscht auf {url}", "description": "" diff --git a/_locales/en/messages.json b/_locales/en/messages.json index bb6d02e..3bcb0ac 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -359,6 +359,10 @@ "description": "" }, + "preBlock": { + "message": "API blocked on {url} because CanvasBlocker-settings were not loaded in time.", + "description": "" + }, "fakedReadout": { "message": "Faked readout on {url}", "description": "" diff --git a/lib/intercept.js b/lib/intercept.js index a792bd2..7884981 100644 --- a/lib/intercept.js +++ b/lib/intercept.js @@ -96,11 +96,25 @@ enumerable: true, configureable: true, get: exportFunction(function(){ - undoPreIntercept(); - settings.forceLoad(); - doRealIntercept(); - var descriptor = Object.getOwnPropertyDescriptor(constructor.prototype, name); - return descriptor.value || descriptor.get(); + var url = getURL(window); + if (!url){ + return undef; + } + var error = new Error(); + apis.notify({ + url, + errorStack: error.stack, + messageId: "preBlock", + timestamp: new Date(), + functionName: name, + dataURL: false + }); + return; + // undoPreIntercept(); + // settings.forceLoad(); + // doRealIntercept(); + // var descriptor = Object.getOwnPropertyDescriptor(constructor.prototype, name); + // return descriptor.value || descriptor.get(); }, window), set: exportFunction(function(){}, window) }