mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02:00
parent
e2efb727b9
commit
f3f6df229f
5 changed files with 122 additions and 58 deletions
|
@ -27,23 +27,12 @@
|
|||
if ((typeof changed) === "function"){
|
||||
changed = extension.exportFunctionWithName(changed, window, original.name);
|
||||
}
|
||||
descriptor[type] = changed;
|
||||
Object.defineProperty(object, name, descriptor);
|
||||
registerChangedProperty(object, name, descriptor, type, original);
|
||||
}
|
||||
const changedProperties = [];
|
||||
// eslint-disable-next-line max-params
|
||||
function registerChangedProperty(object, name, descriptor, type, original){
|
||||
changedProperties.push({object, name, descriptor, type, original});
|
||||
extension.changeProperty(window, "iframeProtection", {object, name, type, changed});
|
||||
}
|
||||
if (settings.isStillDefault){
|
||||
settings.onloaded(function(){
|
||||
if (isWhitelisted(window.location)){
|
||||
changedProperties.forEach(function({object, name, descriptor, type, original}){
|
||||
descriptor[type] = original;
|
||||
Object.defineProperty(object, name, descriptor);
|
||||
});
|
||||
changedProperties.length = 0;
|
||||
extension.revertProperties(window, "iframeProtection");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue