mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02:00
Added window.open protection
This commit is contained in:
parent
a181780020
commit
762367a87b
5 changed files with 55 additions and 0 deletions
16
test/test.js
16
test/test.js
|
@ -45,6 +45,17 @@
|
|||
catch (error){console.error(error);}
|
||||
try {show(document.getElementById("iframe6"), dynamicIframeTest3());}
|
||||
catch (error){console.error(error);}
|
||||
window.addEventListener("click", function windowOpenTest(){
|
||||
window.removeEventListener("click", windowOpenTest);
|
||||
var newWindow = window.open("/");
|
||||
try{
|
||||
show(document.getElementById("windowOpen"), copyToDifferentDocumentTest(newWindow.document));
|
||||
}
|
||||
catch (error){
|
||||
console.error(error);
|
||||
}
|
||||
newWindow.close();
|
||||
});
|
||||
}
|
||||
document.querySelector("#top button").addEventListener("click", function(){
|
||||
show(document.getElementById("top"), topTest());
|
||||
|
@ -67,6 +78,11 @@
|
|||
document.querySelector("#iframe6 button").addEventListener("click", function(){
|
||||
show(document.getElementById("iframe6"), dynamicIframeTest3());
|
||||
});
|
||||
document.querySelector("#windowOpen button").addEventListener("click", function(){
|
||||
var newWindow = window.open("/");
|
||||
show(document.getElementById("windowOpen"), copyToDifferentDocumentTest(newWindow.document));
|
||||
newWindow.close();
|
||||
});
|
||||
}());
|
||||
|
||||
function draw(canvas){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue