views:

1027

answers:

1

I have a page with iframe. Content inside iframe does window.parent.resizeTo calls (or something similar that in result resizes whole browser window). It does so to accomodate for its contents. I want to prevent resizing of whole browser window and just change the size of iframe element instead.

Is there a way to intercept these resize commands in javascript? I tried listening to parent's "resize" events, but they seemed to happen post-factum, when the window is already resized.

+2  A: 

You could make the function do nothing:

var windowResizeTo = window.resizeTo; // In case we want to put it back later
window.resizeTo = function() {};
Greg
This works indeed. I also had to silence some more functions that alter window size: window.resizeBy, window.moveTo, window.moveBy
Pēteris Caune