Bit of an weird request, but I'd like to be able to have a parent window:
- Create a new child window on the same domain (using
window.open
) - Prevent any javascript running in the child window
Currently, I can do this within in the child window by including the following at the very top of the page:
<script>
Function.prototype.call = function() {};
Function.prototype.apply = function() {};
</script>
This pretty much stops any javascript in the child page from running. But is there any way for me to do this from the parent window? Can I somehow inject this code into the child page before any scripts have a chance to run?
Or is there any other way to do this?
Any help appreciated