mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02:00
parent
b361733c73
commit
d09340e84f
10 changed files with 89 additions and 37 deletions
|
@ -48,8 +48,14 @@
|
|||
const temp = {
|
||||
get name(){
|
||||
return checkerWrapper(checker, this, arguments, function(args, check){
|
||||
const {notify, original} = check;
|
||||
const {notify, original, prefs} = check;
|
||||
const originalName = original.call(this, ...args);
|
||||
if (
|
||||
this !== this.top &&
|
||||
prefs("allowWindowNameInFrames", this.location)
|
||||
){
|
||||
return originalName;
|
||||
}
|
||||
const returnedName = windowNames.get(this) || "";
|
||||
if (originalName !== returnedName){
|
||||
notify("fakedWindowReadout");
|
||||
|
|
|
@ -321,6 +321,11 @@
|
|||
defaultValue: false,
|
||||
urlSpecific: true
|
||||
},
|
||||
{
|
||||
name: "allowWindowNameInFrames",
|
||||
defaultValue: false,
|
||||
urlSpecific: true
|
||||
},
|
||||
{
|
||||
name: "protectDOMRect",
|
||||
defaultValue: true,
|
||||
|
@ -383,7 +388,7 @@
|
|||
},
|
||||
{
|
||||
name: "storageVersion",
|
||||
defaultValue: 0.6,
|
||||
defaultValue: 1.0,
|
||||
fixed: true
|
||||
}
|
||||
];
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
|
||||
const settingDefinitions = require("./settingDefinitions");
|
||||
|
||||
scope.validVersions = [undefined, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6];
|
||||
scope.validVersions = [undefined, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 1.0];
|
||||
scope.transitions = {
|
||||
"": function(){
|
||||
return {
|
||||
storageVersion: 0.6
|
||||
storageVersion: 1.0
|
||||
};
|
||||
},
|
||||
0.1: function(oldStorage){
|
||||
|
@ -157,6 +157,25 @@
|
|||
}
|
||||
return newStorage;
|
||||
},
|
||||
0.6: function (oldStorage){
|
||||
const newStorage = {
|
||||
storageVersion: 1.0
|
||||
};
|
||||
if (
|
||||
oldStorage.hasOwnProperty("protectWindow") &&
|
||||
oldStorage.protectWindow &&
|
||||
oldStorage.hasOwnProperty("urlSettings") &&
|
||||
Array.isArray(oldStorage.urlSettings) &&
|
||||
oldStorage.urlSettings.filter(function(entry){
|
||||
return entry.url === "^https://www\\.google\\.com/recaptcha/api2/(?:b?frame|anchor).*$";
|
||||
}).some(function(entry){
|
||||
return entry.protectWindow === false;
|
||||
})
|
||||
){
|
||||
newStorage.allowWindowNameInFrames = true;
|
||||
}
|
||||
return newStorage;
|
||||
}
|
||||
};
|
||||
|
||||
scope.check = function(storage, {settings, logging}){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue