diff --git a/lib/check.js b/lib/check.js index ae269f7..5020a29 100644 --- a/lib/check.js +++ b/lib/check.js @@ -25,6 +25,7 @@ ); if (match){ return { + url: url, type: (match[2] === "Everything" || match[2] === "")? ["context", "readout", "input"]: [match[2].toLowerCase()], @@ -33,6 +34,7 @@ } else { return { + url: url, type: ["context", "readout", "input"], mode: "block" }; diff --git a/lib/intercept.js b/lib/intercept.js index 7eea9f5..00979c6 100644 --- a/lib/intercept.js +++ b/lib/intercept.js @@ -211,7 +211,7 @@ if (checkStack(error.stack)){ return {allow: true, original, window}; } - var funcStatus = changedFunction.getStatus(this, siteStatus); + var funcStatus = changedFunction.getStatus(this, siteStatus, prefs); function notifyCallback(messageId){ notify({ @@ -273,7 +273,7 @@ if (siteStatus.mode !== "allow"){ apiNames.forEach(function(name){ var changedFunction = changedFunctions[name]; - var functionStatus = changedFunction.getStatus(undefined, siteStatus); + var functionStatus = changedFunction.getStatus(undefined, siteStatus, prefs); logging.verbose("status for", name, ":", functionStatus); if (functionStatus.active){ ( @@ -312,7 +312,7 @@ }); changedGetters.forEach(function(changedGetter){ const name = changedGetter.name; - var functionStatus = changedGetter.getStatus(undefined, siteStatus); + var functionStatus = changedGetter.getStatus(undefined, siteStatus, prefs); logging.verbose("status for", changedGetter, ":", functionStatus); if (functionStatus.active){ changedGetter.objectGetters.forEach(function(objectGetter){ diff --git a/lib/modifiedAudioAPI.js b/lib/modifiedAudioAPI.js index 9cb51a9..815f0fd 100644 --- a/lib/modifiedAudioAPI.js +++ b/lib/modifiedAudioAPI.js @@ -90,7 +90,7 @@ const intCache = Object.create(null); function fakeFloat32Array(array, window, prefs){ - if (prefs("protectAudio")){ + if (prefs("protectAudio", window.location)){ let cached = false; let hash; if (prefs("useAudioCache")){ @@ -121,7 +121,7 @@ } } function fakeUint8Array(array, window, prefs){ - if (prefs("protectAudio")){ + if (prefs("protectAudio", window.location)){ let cached = false; let hash; if (prefs("useAudioCache")){ @@ -148,9 +148,9 @@ randomSupply = supply; }; - function getStatus(obj, status){ + function getStatus(obj, status, prefs){ status = Object.create(status); - status.active = hasType(status, "readout"); + status.active = prefs("protectAudio", status.url) && hasType(status, "readout"); return status; } diff --git a/lib/modifiedWindowAPI.js b/lib/modifiedWindowAPI.js index aa0cbc0..b8472c6 100644 --- a/lib/modifiedWindowAPI.js +++ b/lib/modifiedWindowAPI.js @@ -73,9 +73,9 @@ } ]; - function getStatus(obj, status){ + function getStatus(obj, status, prefs){ status = Object.create(status); - status.active = hasType(status, "readout"); + status.active = prefs("protectWindow", status.url) && hasType(status, "readout"); return status; } diff --git a/releaseNotes.txt b/releaseNotes.txt index fbb1923..efa48a7 100644 --- a/releaseNotes.txt +++ b/releaseNotes.txt @@ -6,7 +6,7 @@ Version 0.5.4: - added save/load directly to/from file option fixes: - - + - window and audio API were always blocked when using any of the "block ..." modes known issues: - if a data URL is blocked the page action button does not appear