mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-01-03 10:31:54 +01:00
Audio API notifies on every call
This commit is contained in:
parent
ee7f9b4dae
commit
db79c0129b
@ -154,13 +154,6 @@
|
||||
return status;
|
||||
}
|
||||
|
||||
let notified = new Map();
|
||||
function notifyOnce(name, notify){
|
||||
if (!notified.get(name)){
|
||||
notify("fakedAudioReadout");
|
||||
notified.set(name, true);
|
||||
}
|
||||
}
|
||||
// changed functions and their fakes
|
||||
scope.changedFunctions = {
|
||||
getFloatFrequencyData: {
|
||||
@ -169,7 +162,7 @@
|
||||
return function getFloatFrequencyData(array){
|
||||
return checkerWrapper(checker, this, arguments, function(args, check){
|
||||
var {prefs, notify, window, original} = check;
|
||||
notifyOnce("getFloatFrequencyData", notify);
|
||||
notify("fakedAudioReadout");
|
||||
var ret = original.apply(this, window.Array.from(args));
|
||||
fakeFloat32Array(array, window, prefs);
|
||||
return ret;
|
||||
@ -183,7 +176,7 @@
|
||||
return function getByteFrequencyData(array){
|
||||
return checkerWrapper(checker, this, arguments, function(args, check){
|
||||
var {prefs, notify, window, original} = check;
|
||||
notifyOnce("getByteFrequencyData", notify);
|
||||
notify("fakedAudioReadout");
|
||||
var ret = original.apply(this, window.Array.from(args));
|
||||
fakeUint8Array(array, window, prefs);
|
||||
return ret;
|
||||
@ -197,7 +190,7 @@
|
||||
return function getFloatTimeDomainData(array){
|
||||
return checkerWrapper(checker, this, arguments, function(args, check){
|
||||
var {prefs, notify, window, original} = check;
|
||||
notifyOnce("getFloatTimeDomainData", notify);
|
||||
notify("fakedAudioReadout");
|
||||
var ret = original.apply(this, window.Array.from(args));
|
||||
fakeFloat32Array(array, window, prefs);
|
||||
return ret;
|
||||
@ -211,7 +204,7 @@
|
||||
return function getByteTimeDomainData(array){
|
||||
return checkerWrapper(checker, this, arguments, function(args, check){
|
||||
var {prefs, notify, window, original} = check;
|
||||
notifyOnce("getByteTimeDomainData", notify);
|
||||
notify("fakedAudioReadout");
|
||||
var ret = original.apply(this, window.Array.from(args));
|
||||
fakeUint8Array(array, window, prefs);
|
||||
return ret;
|
||||
@ -225,7 +218,7 @@
|
||||
return function getChannelData(channel){
|
||||
return checkerWrapper(checker, this, arguments, function(args, check){
|
||||
var {prefs, notify, window, original} = check;
|
||||
notifyOnce("getChannelData", notify);
|
||||
notify("fakedAudioReadout");
|
||||
var ret = original.apply(this, window.Array.from(args));
|
||||
fakeFloat32Array(ret, window, prefs);
|
||||
return ret;
|
||||
@ -239,7 +232,7 @@
|
||||
return function copyFromChannel(destination, channelNumber, startInChannel){
|
||||
return checkerWrapper(checker, this, arguments, function(args, check){
|
||||
var {prefs, notify, window, original} = check;
|
||||
notifyOnce("copyFromChannel", notify);
|
||||
notify("fakedAudioReadout");
|
||||
var ret = original.apply(this, window.Array.from(args));
|
||||
fakeFloat32Array(destination, window, prefs);
|
||||
return ret;
|
||||
@ -253,7 +246,7 @@
|
||||
return function getFrequencyResponse(frequencyArray, magResponseOutput, phaseResponseOutput){
|
||||
return checkerWrapper(checker, this, arguments, function(args, check){
|
||||
var {prefs, notify, window, original} = check;
|
||||
notifyOnce("getFrequencyResponse", notify);
|
||||
notify("fakedAudioReadout");
|
||||
var ret = original.apply(this, window.Array.from(args));
|
||||
fakeFloat32Array(magResponseOutput, window, prefs);
|
||||
fakeFloat32Array(phaseResponseOutput, window, prefs);
|
||||
|
@ -3,6 +3,7 @@ Version 0.5.4:
|
||||
- converted "API whitelist" to "protected API features" (automatic settings migration)
|
||||
- notification details are not stored by default
|
||||
- settings page reorganized
|
||||
- audio API notifies on every call
|
||||
|
||||
new features:
|
||||
- added save/load directly to/from file option
|
||||
|
Loading…
x
Reference in New Issue
Block a user