mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-03 20:16:33 +02:00
Get rid of eval.
This commit is contained in:
parent
32f9ea7447
commit
14a4d1cdc2
10 changed files with 96 additions and 50 deletions
|
@ -205,6 +205,17 @@ addTest("function name", function(log){
|
|||
},
|
||||
].map(checkName).some(function(b){return b;});
|
||||
});
|
||||
addTest("exposed getters or setters", function(log){
|
||||
"use strict";
|
||||
|
||||
return Object.keys(window).filter(function(key){
|
||||
if (/^(get|set) /.test(key)){
|
||||
log("found exposed function", JSON.stringify(key));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}).length !== 0;
|
||||
});
|
||||
addTest("property descriptor", function(log){
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -88,7 +88,16 @@
|
|||
"use strict";
|
||||
|
||||
document.body.innerHTML = "<iframe></iframe>";
|
||||
console.log("TEST:", "innerHTML after 1000ms:", compare(test(window[0]), reference));
|
||||
log("TEST:", "innerHTML after 1000ms:", compare(test(window[0]), reference));
|
||||
|
||||
var iFrame = document.createElement("iframe");
|
||||
document.body.appendChild(iFrame);
|
||||
log("TEST:", "appendChild after 1000ms:", compare(test(window[1]), reference));
|
||||
|
||||
var iFrame2 = document.createElement("iframe");
|
||||
iFrame.replaceWith(iFrame2);
|
||||
log("TEST:", "replaceWith after 1000ms:", compare(test(window[1]), reference));
|
||||
|
||||
document.body.innerHTML = "<h1>Iframe protection</h1>" +
|
||||
"Open console (Ctrl + Shift + K) to see results. " +
|
||||
"Depending on your Browser version you might have to check the \"Persist Logs\" flag and reload the page.<br>" +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue