1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 20:46:39 +02:00

Allow cross origin arguments and remove apply(..., Array.from)

Fixes #415
This commit is contained in:
kkapsner 2019-12-29 23:40:39 +01:00
parent 8506757c62
commit 4601dd25af
11 changed files with 38 additions and 37 deletions

View file

@ -166,7 +166,7 @@
return checkerWrapper(checker, this, arguments, function(args, check){
const {prefs, notify, window, original} = check;
notify("fakedAudioReadout");
const ret = original.apply(this, window.Array.from(args));
const ret = original.call(this, ...args);
fakeFloat32Array(array, window, prefs);
return ret;
});
@ -180,7 +180,7 @@
return checkerWrapper(checker, this, arguments, function(args, check){
const {prefs, notify, window, original} = check;
notify("fakedAudioReadout");
const ret = original.apply(this, window.Array.from(args));
const ret = original.call(this, ...args);
fakeUint8Array(array, window, prefs);
return ret;
});
@ -194,7 +194,7 @@
return checkerWrapper(checker, this, arguments, function(args, check){
const {prefs, notify, window, original} = check;
notify("fakedAudioReadout");
const ret = original.apply(this, window.Array.from(args));
const ret = original.call(this, ...args);
fakeFloat32Array(array, window, prefs);
return ret;
});
@ -208,7 +208,7 @@
return checkerWrapper(checker, this, arguments, function(args, check){
const {prefs, notify, window, original} = check;
notify("fakedAudioReadout");
const ret = original.apply(this, window.Array.from(args));
const ret = original.call(this, ...args);
fakeUint8Array(array, window, prefs);
return ret;
});
@ -221,7 +221,7 @@
return function getChannelData(channel){
return checkerWrapper(checker, this, arguments, function(args, check){
const {prefs, notify, window, original} = check;
const ret = original.apply(this, window.Array.from(args));
const ret = original.call(this, ...args);
if (!getChannelDataAlreadyFakedArrays.get(ret)){
notify("fakedAudioReadout");
fakeFloat32Array(ret, window, prefs);
@ -244,7 +244,7 @@
fakeFloat32Array(channelData, window, prefs);
getChannelDataAlreadyFakedArrays.set(channelData, true);
}
const ret = original.apply(this, window.Array.from(args));
const ret = original.call(this, ...args);
return ret;
});
};
@ -257,7 +257,7 @@
return checkerWrapper(checker, this, arguments, function(args, check){
const {prefs, notify, window, original} = check;
notify("fakedAudioReadout");
const ret = original.apply(this, window.Array.from(args));
const ret = original.call(this, ...args);
fakeFloat32Array(magResponseOutput, window, prefs);
fakeFloat32Array(phaseResponseOutput, window, prefs);
return ret;