mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-03 12:06:31 +02:00
Added window.open protection
This commit is contained in:
parent
a181780020
commit
762367a87b
5 changed files with 55 additions and 0 deletions
|
@ -65,5 +65,11 @@
|
|||
Hash: <span class="hash"></span> (isPointInPath: <span class="isPointInPath"></span>)
|
||||
<button>refresh</button>
|
||||
</div>
|
||||
<div id="windowOpen">
|
||||
<h3>window.open Test</h3>
|
||||
<img class="display"><br>
|
||||
Hash: <span class="hash"><i>click anywhere to populate</i></span> (isPointInPath: <span class="isPointInPath"></span>)
|
||||
<button>refresh</button>
|
||||
</div>
|
||||
<script src="test.js"></script>
|
||||
</body></html>
|
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