开发者

force iframe or disable javascript

开发者 https://www.devze.com 2023-04-04 00:18 出处:网络
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. Whe

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');
}
0

精彩评论

暂无评论...
验证码 换一张
取 消