mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 04:26:35 +02:00
Merge branch 'master' into DOMRect
This commit is contained in:
commit
bda97dbc38
10 changed files with 17 additions and 15 deletions
|
@ -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"
|
||||
};
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
}
|
||||
|
||||
scope.init = function(){
|
||||
function listener(details){console.log("listener");
|
||||
function listener(details){
|
||||
const headers = details.responseHeaders;
|
||||
if (settings.blockDataURLs){
|
||||
const cspMatch = (blockBlob? "": "blob: ") + "filesystem: *";
|
||||
|
|
|
@ -220,7 +220,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({
|
||||
|
@ -282,7 +282,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){
|
||||
(
|
||||
|
@ -323,7 +323,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){
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
})
|
||||
.map(function(entry){
|
||||
var regExp;
|
||||
var domain = !!entry.match(/^[\w.]+$/);
|
||||
var domain = !!entry.match(/^[A-Za-z0-9_.-]+$/);
|
||||
if (domain){
|
||||
regExp = new RegExp("(?:^|\\.)" + entry.replace(/([\\+*?[^\]$(){}=!|.])/g, "\\$1") + "\\.?$", "i");
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -461,7 +461,7 @@
|
|||
urlContainer.on(function({newValue, oldValue}){
|
||||
newValue.forEach(function(urlSetting){
|
||||
var regExp;
|
||||
var domain = !!urlSetting.url.match(/^[\w.]+$/);
|
||||
var domain = !!urlSetting.url.match(/^[A-Za-z0-9_.-]+$/);
|
||||
if (domain){
|
||||
regExp = new RegExp(
|
||||
"(?:^|\\.)" + urlSetting.url.replace(/([\\+*?[^\]$(){}=!|.])/g, "\\$1") + "\\.?$",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue