I have a situation where I have to load a page in a frame. This page is not mine, so I cannot edit its code. I want it to load inside the iframe, but it overtakes the browser tab. When I took a look at the source, i found a function that does:
top.location.href = window.location.href;
Is there a way I can block a call to just this function, or if I somehow I can force this page to stay inside the frame. Thanks for the help!
in your main file put
top = new Object();
top.location = new Object();
top.location.href = function(){
alert('its calling me');
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.