Yes, it looks like this attempt at a script makes itself a parent frame, if it hasn't been. AS Pointy said that they do not always work. Javascript cannot “escape” from its owner document in most browsers if it has not created this document. Or if the page containing Javascript was loaded dynamically so that the policy of the same domain is not valid. (This is probably not the case if your site is in an iframe / frame). In the case of a page that opens inside another, the script should not have access to modify the parent document.
, , .
if(window.top!==window.self){
document.write="";
window.top.location=window.self.location;
setTimeout( function(){document.body.innerHTML=""}, 1);
window.self.onload = function(){document.body.innerHTML=""}
};