Changed pre-intercept to block

... instead of forcing the loading of the settings with a synchonous
XHR.
This commit is contained in:
kkapsner 2017-12-11 20:59:56 +01:00
parent 871199cbc3
commit 3e214ed967
3 changed files with 27 additions and 5 deletions

View File

@ -359,6 +359,10 @@
"description": "" "description": ""
}, },
"preBlock": {
"message": "API auf {url} blockiert, weil die CanvasBlocker-Einstellungen nicht rechtzeitig geladen wurden.",
"description": ""
},
"fakedReadout": { "fakedReadout": {
"message": "Auslese vorgetäuscht auf {url}", "message": "Auslese vorgetäuscht auf {url}",
"description": "" "description": ""

View File

@ -359,6 +359,10 @@
"description": "" "description": ""
}, },
"preBlock": {
"message": "API blocked on {url} because CanvasBlocker-settings were not loaded in time.",
"description": ""
},
"fakedReadout": { "fakedReadout": {
"message": "Faked readout on {url}", "message": "Faked readout on {url}",
"description": "" "description": ""

View File

@ -96,11 +96,25 @@
enumerable: true, enumerable: true,
configureable: true, configureable: true,
get: exportFunction(function(){ get: exportFunction(function(){
undoPreIntercept(); var url = getURL(window);
settings.forceLoad(); if (!url){
doRealIntercept(); return undef;
var descriptor = Object.getOwnPropertyDescriptor(constructor.prototype, name); }
return descriptor.value || descriptor.get(); 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), }, window),
set: exportFunction(function(){}, window) set: exportFunction(function(){}, window)
} }